Environment
zenml.environment
Environment implementation.
Attributes
INSIDE_ZENML_CONTAINER = handle_bool_env_var(ENV_ZENML_CONTAINER, False)
module-attribute
logger = get_logger(__name__)
module-attribute
Classes
Environment()
Provides environment information.
Initializes an Environment instance.
Note: Environment is a singleton class, which means this method will
only get called once. All following Environment() calls will return
the previously initialized instance.
Source code in src/zenml/environment.py
109 110 111 112 113 114 115 | |
Functions
get_python_packages() -> List[str]
staticmethod
Returns a list of installed Python packages.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the process to get the list of installed packages fails. |
Returns:
| Type | Description |
|---|---|
List[str]
|
List of installed packages in pip freeze format. |
Source code in src/zenml/environment.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
get_system_info() -> Dict[str, str]
staticmethod
Information about the operating system.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
A dictionary containing information about the operating system. |
Source code in src/zenml/environment.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
in_bitbucket_ci() -> bool
staticmethod
If the current Python process is running in Bitbucket CI.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
CI, |
Source code in src/zenml/environment.py
324 325 326 327 328 329 330 331 332 | |
in_ci() -> bool
staticmethod
If the current Python process is running in any CI.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
CI, |
Source code in src/zenml/environment.py
334 335 336 337 338 339 340 341 342 | |
in_circle_ci() -> bool
staticmethod
If the current Python process is running in Circle CI.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
CI, |
Source code in src/zenml/environment.py
314 315 316 317 318 319 320 321 322 | |
in_container() -> bool
staticmethod
If the current python process is running in a container.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
container, |
Source code in src/zenml/environment.py
160 161 162 163 164 165 166 167 168 169 | |
in_docker() -> bool
staticmethod
If the current python process is running in a docker container.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
container, |
Source code in src/zenml/environment.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
in_github_actions() -> bool
staticmethod
If the current Python process is running in GitHub Actions.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
Actions, |
Source code in src/zenml/environment.py
294 295 296 297 298 299 300 301 302 | |
in_github_codespaces() -> bool
staticmethod
If the current Python process is running in GitHub Codespaces.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
|
Source code in src/zenml/environment.py
247 248 249 250 251 252 253 254 255 256 257 258 259 | |
in_gitlab_ci() -> bool
staticmethod
If the current Python process is running in GitLab CI.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
CI, |
Source code in src/zenml/environment.py
304 305 306 307 308 309 310 311 312 | |
in_google_colab() -> bool
staticmethod
If the current Python process is running in a Google Colab.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
|
Source code in src/zenml/environment.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
in_kubernetes() -> bool
staticmethod
If the current python process is running in a kubernetes pod.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
pod, |
Source code in src/zenml/environment.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
in_lightning_ai_studio() -> bool
staticmethod
If the current Python process is running in Lightning.ai studios.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
|
Source code in src/zenml/environment.py
355 356 357 358 359 360 361 362 363 364 365 366 | |
in_notebook() -> bool
staticmethod
If the current Python process is running in a notebook.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
|
Source code in src/zenml/environment.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
in_paperspace_gradient() -> bool
staticmethod
If the current Python process is running in Paperspace Gradient.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
Gradient, |
Source code in src/zenml/environment.py
284 285 286 287 288 289 290 291 292 | |
in_vscode_remote_container() -> bool
staticmethod
If the current Python process is running in a VS Code Remote Container.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
|
Source code in src/zenml/environment.py
271 272 273 274 275 276 277 278 279 280 281 282 | |
in_wsl() -> bool
staticmethod
If the current process is running in Windows Subsystem for Linux.
source: https://www.scivision.dev/python-detect-wsl/
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in src/zenml/environment.py
344 345 346 347 348 349 350 351 352 353 | |
in_zenml_codespace() -> bool
staticmethod
If the current Python process is running in ZenML Codespaces.
Returns:
| Type | Description |
|---|---|
bool
|
|
bool
|
|
Source code in src/zenml/environment.py
261 262 263 264 265 266 267 268 269 | |
python_version() -> str
staticmethod
Returns the python version of the running interpreter.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
the python version |
Source code in src/zenml/environment.py
151 152 153 154 155 156 157 158 | |
EnvironmentType
SingletonMetaClass(*args: Any, **kwargs: Any)
Bases: type
Singleton metaclass.
Use this metaclass to make any class into a singleton class:
class OneRing(metaclass=SingletonMetaClass):
def __init__(self, owner):
self._owner = owner
@property
def owner(self):
return self._owner
the_one_ring = OneRing('Sauron')
the_lost_ring = OneRing('Frodo')
print(the_lost_ring.owner) # Sauron
OneRing._clear() # ring destroyed
Initialize a singleton class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Any
|
Additional arguments. |
()
|
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Source code in src/zenml/utils/singleton.py
41 42 43 44 45 46 47 48 49 | |
Functions
Functions
get_environment() -> str
Returns a string representing the execution environment of the pipeline.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
the execution environment |
Source code in src/zenml/environment.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
get_logger(logger_name: str) -> logging.Logger
Main function to get logger name,.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger_name
|
str
|
Name of logger to initialize. |
required |
Returns:
| Type | Description |
|---|---|
Logger
|
A logger object. |
Source code in src/zenml/logger.py
74 75 76 77 78 79 80 81 82 83 | |
get_run_environment_dict() -> Dict[str, Any]
Returns a dictionary of the current run environment.
Everything that is returned here will be saved in the DB as
pipeline_run.client_environment and
pipeline_run.orchestrator_environment for client and orchestrator
respectively.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
A dictionary of the current run environment. |
Source code in src/zenml/environment.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
Modules
zenml
Initialization for ZenML.
Classes
APIKey
Bases: BaseModel
Encoded model for API keys.
decode_api_key(encoded_key: str) -> APIKey
classmethod
Decodes an API key from a base64 string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
encoded_key
|
str
|
The encoded API key. |
required |
Returns:
| Type | Description |
|---|---|
APIKey
|
The decoded API key. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the key is not valid. |
Source code in src/zenml/models/v2/core/api_key.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
encode() -> str
Encodes the API key in a base64 string that includes the key ID and prefix.
Returns:
| Type | Description |
|---|---|
str
|
The encoded API key. |
Source code in src/zenml/models/v2/core/api_key.py
71 72 73 74 75 76 77 78 | |
APIKeyFilter
Bases: BaseFilter
Filter model for API keys.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to apply the service account scope as an additional filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/api_key.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |
set_service_account(service_account_id: UUID) -> None
Set the service account by which to scope this query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service_account_id
|
UUID
|
The service account ID. |
required |
Source code in src/zenml/models/v2/core/api_key.py
378 379 380 381 382 383 384 | |
APIKeyInternalResponse
Bases: APIKeyResponse
Response model for API keys used internally.
verify_key(key: str) -> bool
Verifies a given key against the stored (hashed) key(s).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Input key to be verified. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the keys match. |
Source code in src/zenml/models/v2/core/api_key.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | |
APIKeyInternalUpdate
APIKeyRequest
APIKeyResponse
Bases: BaseIdentifiedResponse[APIKeyResponseBody, APIKeyResponseMetadata, APIKeyResponseResources]
Response model for API keys.
active: bool
property
The active property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
description: str
property
The description property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
key: Optional[str]
property
The key property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
last_login: Optional[datetime]
property
The last_login property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
last_rotated: Optional[datetime]
property
The last_rotated property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
retain_period_minutes: int
property
The retain_period_minutes property.
Returns:
| Type | Description |
|---|---|
int
|
the value of the property. |
service_account: ServiceAccountResponse
property
The service_account property.
Returns:
| Type | Description |
|---|---|
ServiceAccountResponse
|
the value of the property. |
get_hydrated_version() -> APIKeyResponse
Get the hydrated version of this API key.
Returns:
| Type | Description |
|---|---|
APIKeyResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/api_key.py
197 198 199 200 201 202 203 204 205 206 207 208 | |
set_key(key: str) -> None
Sets the API key and encodes it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The API key value to be set. |
required |
Source code in src/zenml/models/v2/core/api_key.py
211 212 213 214 215 216 217 | |
APIKeyResponseBody
APIKeyResponseMetadata
APIKeyRotateRequest
APIKeyUpdate
ActionFilter
ActionFlavorResponse
Bases: BasePluginFlavorResponse[ActionFlavorResponseBody, ActionFlavorResponseMetadata, ActionFlavorResponseResources]
Response model for Action Flavors.
config_schema: Dict[str, Any]
property
The source_config_schema property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
ActionFlavorResponseBody
ActionFlavorResponseMetadata
ActionFlavorResponseResources
ActionRequest
ActionResponse
Bases: ProjectScopedResponse[ActionResponseBody, ActionResponseMetadata, ActionResponseResources]
Response model for actions.
auth_window: int
property
The auth_window property.
Returns:
| Type | Description |
|---|---|
int
|
the value of the property. |
configuration: Dict[str, Any]
property
The configuration property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
description: str
property
The description property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
flavor: str
property
The flavor property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
plugin_subtype: PluginSubType
property
service_account: UserResponse
property
get_hydrated_version() -> ActionResponse
Get the hydrated version of this action.
Returns:
| Type | Description |
|---|---|
ActionResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/action.py
184 185 186 187 188 189 190 191 192 | |
set_configuration(configuration: Dict[str, Any]) -> None
Set the configuration property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
configuration
|
Dict[str, Any]
|
The value to set. |
required |
Source code in src/zenml/models/v2/core/action.py
240 241 242 243 244 245 246 | |
ActionResponseBody
ActionResponseMetadata
ActionResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the action entity.
ActionUpdate
Bases: BaseUpdate
Update model for actions.
from_response(response: ActionResponse) -> ActionUpdate
classmethod
Create an update model from a response model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
ActionResponse
|
The response model to create the update model from. |
required |
Returns:
| Type | Description |
|---|---|
ActionUpdate
|
The update model. |
Source code in src/zenml/models/v2/core/action.py
116 117 118 119 120 121 122 123 124 125 126 127 128 | |
ApiTransactionRequest
ApiTransactionResponse
Bases: UserScopedResponse[ApiTransactionResponseBody, ApiTransactionResponseMetadata, ApiTransactionResponseResources]
Response model for API transactions.
completed: bool
property
The completed property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
method: str
property
The method property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
result: Optional[PlainSerializedSecretStr]
property
The result property.
Returns:
| Type | Description |
|---|---|
Optional[PlainSerializedSecretStr]
|
the value of the property. |
url: str
property
The url property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
get_hydrated_version() -> ApiTransactionResponse
Get the hydrated version of this API transaction.
Returns:
| Type | Description |
|---|---|
ApiTransactionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/api_transaction.py
130 131 132 133 134 135 136 | |
get_result() -> Optional[str]
Get the result of the API transaction.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the result of the API transaction. |
Source code in src/zenml/models/v2/core/api_transaction.py
176 177 178 179 180 181 182 183 184 185 | |
set_result(result: str) -> None
Set the result of the API transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
str
|
the result of the API transaction. |
required |
Source code in src/zenml/models/v2/core/api_transaction.py
187 188 189 190 191 192 193 | |
ApiTransactionResponseBody
ApiTransactionResponseMetadata
ApiTransactionResponseResources
ApiTransactionUpdate
Bases: BaseUpdate
Update model for stack components.
get_result() -> Optional[str]
Get the result of the API transaction.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the result of the API transaction. |
Source code in src/zenml/models/v2/core/api_transaction.py
72 73 74 75 76 77 78 79 80 81 | |
set_result(result: str) -> None
Set the result of the API transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
str
|
the result of the API transaction. |
required |
Source code in src/zenml/models/v2/core/api_transaction.py
83 84 85 86 87 88 89 | |
ArtifactConfig
Bases: BaseModel
Artifact configuration class.
Can be used in step definitions to define various artifact properties.
Example:
@step
def my_step() -> Annotated[
int, ArtifactConfig(
name="my_artifact", # override the default artifact name
version=42, # set a custom version
artifact_type=ArtifactType.MODEL, # Specify the artifact type
tags=["tag1", "tag2"], # set custom tags
)
]:
return ...
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Optional[str]
|
The name of the artifact:
- static string e.g. "name"
- dynamic string e.g. "name_{date}{time}{custom_placeholder}"
If you use any placeholders besides |
version |
Optional[Union[str, int]]
|
The version of the artifact. |
tags |
Optional[List[str]]
|
The tags of the artifact. |
run_metadata |
Optional[Dict[str, MetadataType]]
|
Metadata to add to the artifact. |
artifact_type |
Optional[ArtifactType]
|
Optional type of the artifact. If not given, the type specified by the materializer that is used to save this artifact is used. |
ArtifactFilter
Bases: ProjectScopedFilter, TaggableFilter
Model to enable advanced filtering of artifacts.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query for Artifacts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/artifact.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
ArtifactRequest
ArtifactResponse
Bases: ProjectScopedResponse[ArtifactResponseBody, ArtifactResponseMetadata, ArtifactResponseResources]
Artifact response model.
has_custom_name: bool
property
The has_custom_name property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
latest_version_id: Optional[UUID]
property
The latest_version_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
latest_version_name: Optional[str]
property
The latest_version_name property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
tags: List[TagResponse]
property
versions: Dict[str, ArtifactVersionResponse]
property
Get a list of all versions of this artifact.
Returns:
| Type | Description |
|---|---|
Dict[str, ArtifactVersionResponse]
|
A list of all versions of this artifact. |
get_hydrated_version() -> ArtifactResponse
Get the hydrated version of this artifact.
Returns:
| Type | Description |
|---|---|
ArtifactResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact.py
120 121 122 123 124 125 126 127 128 | |
ArtifactResponseBody
ArtifactResponseMetadata
ArtifactResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the Artifact Entity.
ArtifactUpdate
ArtifactVersionFilter
Bases: ProjectScopedFilter, TaggableFilter, RunMetadataFilterMixin
Model to enable advanced filtering of artifact versions.
get_custom_filters(table: Type[AnySchema]) -> List[Union[ColumnElement[bool]]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[Union[ColumnElement[bool]]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/artifact_version.py
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 | |
ArtifactVersionIdentifier
ArtifactVersionRequest
Bases: ProjectScopedRequest
Request model for artifact versions.
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum str length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
| Type | Description |
|---|---|
Any
|
the value itself. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/artifact_version.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
ArtifactVersionResponse
Bases: ProjectScopedResponse[ArtifactVersionResponseBody, ArtifactVersionResponseMetadata, ArtifactVersionResponseResources]
Response model for artifact versions.
artifact: ArtifactResponse
property
artifact_store_id: Optional[UUID]
property
The artifact_store_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
content_hash: Optional[str]
property
The content_hash property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
data_type: Source
property
item_count: Optional[int]
property
The item_count property.
Returns:
| Type | Description |
|---|---|
Optional[int]
|
the value of the property. |
materializer: Source
property
name: str
property
The name property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
producer_pipeline_run_id: Optional[UUID]
property
The producer_pipeline_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
producer_step_run_id: Optional[UUID]
property
The producer_step_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
run: PipelineRunResponse
property
Get the pipeline run that produced this artifact.
Returns:
| Type | Description |
|---|---|
PipelineRunResponse
|
The pipeline run that produced this artifact. |
run_metadata: Dict[str, MetadataType]
property
save_type: ArtifactSaveType
property
step: StepRunResponse
property
Get the step that produced this artifact.
Returns:
| Type | Description |
|---|---|
StepRunResponse
|
The step that produced this artifact. |
tags: List[TagResponse]
property
type: ArtifactType
property
uri: str
property
The uri property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
version: str
property
The version property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
visualizations: Optional[List[ArtifactVisualizationResponse]]
property
The visualizations property.
Returns:
| Type | Description |
|---|---|
Optional[List[ArtifactVisualizationResponse]]
|
the value of the property. |
download_files(path: str, overwrite: bool = False) -> None
Downloads data for an artifact with no materializing.
Any artifacts will be saved as a zip file to the given path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The path to save the binary data to. |
required |
overwrite
|
bool
|
Whether to overwrite the file if it already exists. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the path does not end with '.zip'. |
Source code in src/zenml/models/v2/core/artifact_version.py
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
get_hydrated_version() -> ArtifactVersionResponse
Get the hydrated version of this artifact version.
Returns:
| Type | Description |
|---|---|
ArtifactVersionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact_version.py
284 285 286 287 288 289 290 291 292 | |
load(disable_cache: bool = False) -> Any
Materializes (loads) the data stored in this artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
disable_cache
|
bool
|
Whether to disable the artifact cache. |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
The materialized data. |
Source code in src/zenml/models/v2/core/artifact_version.py
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | |
visualize(title: Optional[str] = None) -> None
Visualize the artifact in notebook environments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
Optional[str]
|
Optional title to show before the visualizations. |
None
|
Source code in src/zenml/models/v2/core/artifact_version.py
513 514 515 516 517 518 519 520 521 | |
ArtifactVersionResponseBody
Bases: ProjectScopedResponseBody
Response body for artifact versions.
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum str length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
| Type | Description |
|---|---|
Any
|
the value itself. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/artifact_version.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
ArtifactVersionResponseMetadata
ArtifactVersionResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the artifact version entity.
ArtifactVersionUpdate
ArtifactVisualizationRequest
ArtifactVisualizationResponse
Bases: BaseIdentifiedResponse[ArtifactVisualizationResponseBody, ArtifactVisualizationResponseMetadata, ArtifactVisualizationResponseResources]
Response model for artifact visualizations.
artifact_version: Optional[ArtifactVersionResponse]
property
The artifact version resource, if the response was hydrated with it.
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
The artifact version resource, if available. |
artifact_version_id: UUID
property
The artifact_version_id property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
type: VisualizationType
property
uri: str
property
The uri property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
get_hydrated_version() -> ArtifactVisualizationResponse
Get the hydrated version of this artifact visualization.
Returns:
| Type | Description |
|---|---|
ArtifactVisualizationResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact_visualization.py
82 83 84 85 86 87 88 89 90 | |
ArtifactVisualizationResponseBody
ArtifactVisualizationResponseMetadata
ArtifactVisualizationResponseResources
Bases: BaseResponseResources
Class for all resource models associated with the artifact visualization.
AuthenticationMethodModel(config_class: Optional[Type[BaseModel]] = None, **values: Any)
Bases: BaseModel
Authentication method specification.
Describes the schema for the configuration and secrets that need to be provided to configure an authentication method.
Initialize the authentication method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_class
|
Optional[Type[BaseModel]]
|
The configuration class for the authentication method. |
None
|
**values
|
Any
|
The data to initialize the authentication method with. |
{}
|
Source code in src/zenml/models/v2/misc/service_connector_type.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
config_class: Optional[Type[BaseModel]]
property
Get the configuration class for the authentication method.
Returns:
| Type | Description |
|---|---|
Optional[Type[BaseModel]]
|
The configuration class for the authentication method. |
supports_temporary_credentials() -> bool
Check if the authentication method supports temporary credentials.
Returns:
| Type | Description |
|---|---|
bool
|
True if the authentication method supports temporary credentials, |
bool
|
False otherwise. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
157 158 159 160 161 162 163 164 165 166 167 168 | |
validate_expiration(expiration_seconds: Optional[int]) -> Optional[int]
Validate the expiration time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expiration_seconds
|
Optional[int]
|
The expiration time in seconds. If None, the default expiration time is used, if applicable. |
required |
Returns:
| Type | Description |
|---|---|
Optional[int]
|
The expiration time in seconds or None if not applicable. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the expiration time is not valid. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
BaseDatedResponseBody
Bases: BaseResponseBody
Base body model for entities that track a creation and update timestamp.
Used as a base class for all body models associated with responses. Features a creation and update timestamp.
BaseFilter
Bases: BaseModel
Class to unify all filter, paginate and sort request parameters.
This Model allows fine-grained filtering, sorting and pagination of resources.
Usage example for subclasses of this class:
ResourceListModel(
name="contains:default",
project="default"
count_steps="gte:5"
sort_by="created",
page=2,
size=20
)
list_of_filters: List[Filter]
property
Converts the class variables into a list of usable Filter Models.
Returns:
| Type | Description |
|---|---|
List[Filter]
|
A list of Filter models. |
offset: int
property
Returns the offset needed for the query on the data persistence layer.
Returns:
| Type | Description |
|---|---|
int
|
The offset for the query. |
sorting_params: Tuple[str, SorterOps]
property
Converts the class variables into a list of usable Filter Models.
Returns:
| Type | Description |
|---|---|
Tuple[str, SorterOps]
|
A tuple of the column to sort by and the sorting operand. |
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/filter.py
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 | |
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/filter.py
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 | |
configure_rbac(authenticated_user_id: UUID, **column_allowed_ids: Optional[Set[UUID]]) -> None
Configure RBAC allowed column values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
authenticated_user_id
|
UUID
|
ID of the authenticated user. All entities owned by this user will be included. |
required |
column_allowed_ids
|
Optional[Set[UUID]]
|
Set of IDs per column to limit the query to.
If given, the remaining filters will be applied to entities
within this set only. If |
{}
|
Source code in src/zenml/models/v2/base/filter.py
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 | |
filter_ops(data: Dict[str, Any]) -> Dict[str, Any]
classmethod
Parse incoming filters to ensure all filters are legal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dict[str, Any]
|
The values of the class. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The values of the class. |
Source code in src/zenml/models/v2/base/filter.py
654 655 656 657 658 659 660 661 662 663 664 665 666 667 | |
generate_custom_query_conditions_for_column(value: Any, table: Type[SQLModel], column: str) -> ColumnElement[bool]
staticmethod
Generate custom filter conditions for a column of a table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The filter value. |
required |
table
|
Type[SQLModel]
|
The table which contains the column. |
required |
column
|
str
|
The column name. |
required |
Returns:
| Type | Description |
|---|---|
ColumnElement[bool]
|
The query conditions. |
Source code in src/zenml/models/v2/base/filter.py
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | |
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
| Type | Description |
|---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If a valid logical operator is not supplied. |
Source code in src/zenml/models/v2/base/filter.py
905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 | |
generate_name_or_id_query_conditions(value: Union[UUID, str], table: Type[NamedSchema], additional_columns: Optional[List[str]] = None) -> ColumnElement[bool]
Generate filter conditions for name or id of a table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Union[UUID, str]
|
The filter value. |
required |
table
|
Type[NamedSchema]
|
The table to filter. |
required |
additional_columns
|
Optional[List[str]]
|
Additional table columns that should also filter for the given value as part of the or condition. |
None
|
Returns:
| Type | Description |
|---|---|
ColumnElement[bool]
|
The query conditions. |
Source code in src/zenml/models/v2/base/filter.py
829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 | |
generate_rbac_filter(table: Type[AnySchema]) -> Optional[ColumnElement[bool]]
Generates an optional RBAC filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
Optional[ColumnElement[bool]]
|
The RBAC filter. |
Source code in src/zenml/models/v2/base/filter.py
716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 | |
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
This can be overridden by subclasses to define custom filters that are not based on the columns of the underlying table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/filter.py
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 | |
validate_sort_by(value: Any) -> Any
classmethod
Validate that the sort_column is a valid column with a valid operand.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The sort_by field value. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The validated sort_by field value. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If the sort_by field is not a string. |
ValueError
|
If the resource can't be sorted by this field. |
Source code in src/zenml/models/v2/base/filter.py
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | |
BaseIdentifiedResponse
Bases: BaseResponse[AnyDatedBody, AnyMetadata, AnyResources], Generic[AnyDatedBody, AnyMetadata, AnyResources]
Base domain model for resources with DB representation.
created: datetime
property
The created property.
Returns:
| Type | Description |
|---|---|
datetime
|
the value of the property. |
updated: datetime
property
The updated property.
Returns:
| Type | Description |
|---|---|
datetime
|
the value of the property. |
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for base response models.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/base.py
456 457 458 459 460 461 462 463 464 | |
get_body() -> AnyDatedBody
Fetch the body of the entity.
Returns:
| Type | Description |
|---|---|
AnyDatedBody
|
The body field of the response. |
Raises:
| Type | Description |
|---|---|
IllegalOperationError
|
If the user lacks permission to access the entity represented by this response. |
Source code in src/zenml/models/v2/base/base.py
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |
get_hydrated_version() -> BaseIdentifiedResponse[AnyDatedBody, AnyMetadata, AnyResources]
Abstract method to fetch the hydrated version of the model.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
in case the method is not implemented. |
Source code in src/zenml/models/v2/base/base.py
406 407 408 409 410 411 412 413 414 415 416 417 | |
get_metadata() -> AnyMetadata
Fetch the metadata of the entity.
Returns:
| Type | Description |
|---|---|
AnyMetadata
|
The metadata field of the response. |
Raises:
| Type | Description |
|---|---|
IllegalOperationError
|
If the user lacks permission to access this entity represented by this response. |
Source code in src/zenml/models/v2/base/base.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | |
BasePluginFlavorResponse
Bases: BaseResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources], Generic[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
Base response for all Plugin Flavors.
get_hydrated_version() -> BasePluginFlavorResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
Abstract method to fetch the hydrated version of the model.
Returns:
| Type | Description |
|---|---|
BasePluginFlavorResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
|
Hydrated version of the PluginFlavorResponse |
Source code in src/zenml/models/v2/base/base_plugin_flavor.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
BaseRequest
BaseResponse
Bases: BaseZenModel, Generic[AnyBody, AnyMetadata, AnyResources]
Base domain model for all responses.
get_body() -> AnyBody
Fetch the body of the entity.
Returns:
| Type | Description |
|---|---|
AnyBody
|
The body field of the response. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the body was not included in the response. |
Source code in src/zenml/models/v2/base/base.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
get_hydrated_version() -> BaseResponse[AnyBody, AnyMetadata, AnyResources]
Abstract method to fetch the hydrated version of the model.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
in case the method is not implemented. |
Source code in src/zenml/models/v2/base/base.py
221 222 223 224 225 226 227 228 229 230 231 232 | |
get_metadata() -> AnyMetadata
Fetch the metadata of the entity.
Returns:
| Type | Description |
|---|---|
AnyMetadata
|
The metadata field of the response. |
Source code in src/zenml/models/v2/base/base.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
get_resources() -> AnyResources
Fetch the resources related to this entity.
Returns:
| Type | Description |
|---|---|
AnyResources
|
The resources field of the response. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the resources field was not included in the response. |
Source code in src/zenml/models/v2/base/base.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
hydrate() -> None
Hydrate the response.
Source code in src/zenml/models/v2/base/base.py
213 214 215 216 217 218 219 | |
BaseResponseBody
BaseResponseMetadata
Bases: BaseZenModel
Base metadata model.
Used as a base class for all metadata models associated with responses.
BaseResponseResources
Bases: BaseZenModel
Base resources model.
Used as a base class for all resource models associated with responses.
BaseUpdate
BaseZenModel
Bases: YAMLSerializationMixin, AnalyticsTrackedModelMixin
Base model class for all ZenML models.
This class is used as a base class for all ZenML models. It provides functionality for tracking analytics events.
BoolFilter
Bases: Filter
Filter for all Boolean fields.
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a boolean column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column
|
Any
|
The boolean column of an SQLModel table on which to filter. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
155 156 157 158 159 160 161 162 163 164 165 166 167 | |
BuildItem
Bases: BaseModel
Pipeline build item.
Attributes:
| Name | Type | Description |
|---|---|---|
image |
str
|
The image name or digest. |
dockerfile |
Optional[str]
|
The contents of the Dockerfile used to build the image. |
requirements |
Optional[str]
|
The pip requirements installed in the image. This is a string consisting of multiple concatenated requirements.txt files. |
settings_checksum |
Optional[str]
|
Checksum of the settings used for the build. |
contains_code |
bool
|
Whether the image contains user files. |
requires_code_download |
bool
|
Whether the image needs to download files. |
CodeReferenceRequest
CodeReferenceResponse
Bases: BaseIdentifiedResponse[CodeReferenceResponseBody, CodeReferenceResponseMetadata, CodeReferenceResponseResources]
Response model for code references.
code_repository: CodeRepositoryResponse
property
The code_repository property.
Returns:
| Type | Description |
|---|---|
CodeRepositoryResponse
|
the value of the property. |
commit: str
property
The commit property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
subdirectory: str
property
The subdirectory property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
get_hydrated_version() -> CodeReferenceResponse
Get the hydrated version of this code reference.
Returns:
| Type | Description |
|---|---|
CodeReferenceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/code_reference.py
85 86 87 88 89 90 91 92 93 | |
CodeReferenceResponseBody
CodeReferenceResponseMetadata
CodeRepositoryFilter
CodeRepositoryRequest
CodeRepositoryResponse
Bases: ProjectScopedResponse[CodeRepositoryResponseBody, CodeRepositoryResponseMetadata, CodeRepositoryResponseResources]
Response model for code repositories.
config: Dict[str, Any]
property
The config property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
description: Optional[str]
property
The description property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
source: Source
property
get_hydrated_version() -> CodeRepositoryResponse
Get the hydrated version of this code repository.
Returns:
| Type | Description |
|---|---|
CodeRepositoryResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/code_repository.py
133 134 135 136 137 138 139 140 141 | |
CodeRepositoryResponseBody
CodeRepositoryResponseMetadata
CodeRepositoryResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the code repository entity.
CodeRepositoryUpdate
ComponentBase
Bases: BaseModel
Base model for components.
ComponentFilter
Bases: UserScopedFilter
Model to enable advanced stack component filtering.
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Stack components can be scoped by type to narrow the search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
| Type | Description |
|---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Source code in src/zenml/models/v2/core/component.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
set_scope_type(component_type: str) -> None
Set the type of component on which to perform the filtering to scope the response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_type
|
str
|
The type of component to scope the query to. |
required |
Source code in src/zenml/models/v2/core/component.py
430 431 432 433 434 435 436 | |
ComponentInfo
Bases: BaseModel
Information about each stack components when creating a full stack.
ComponentRequest
Bases: ComponentBase, UserScopedRequest
Request model for stack components.
name_cant_be_a_secret_reference(name: str) -> str
classmethod
Validator to ensure that the given name is not a secret reference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name to validate. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The name if it is not a secret reference. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the name is a secret reference. |
Source code in src/zenml/models/v2/core/component.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
ComponentResponse
Bases: UserScopedResponse[ComponentResponseBody, ComponentResponseMetadata, ComponentResponseResources]
Response model for stack components.
configuration: Dict[str, Any]
property
The configuration property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
connector: Optional[ServiceConnectorResponse]
property
The connector property.
Returns:
| Type | Description |
|---|---|
Optional[ServiceConnectorResponse]
|
the value of the property. |
connector_resource_id: Optional[str]
property
The connector_resource_id property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
environment: Dict[str, str]
property
The environment property.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
the value of the property. |
flavor: FlavorResponse
property
flavor_name: str
property
The flavor_name property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
integration: Optional[str]
property
The integration property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
labels: Optional[Dict[str, Any]]
property
The labels property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
secrets: List[UUID]
property
The secrets property.
Returns:
| Type | Description |
|---|---|
List[UUID]
|
the value of the property. |
type: StackComponentType
property
get_analytics_metadata() -> Dict[str, Any]
Add the component labels to analytics metadata.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/component.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
get_hydrated_version() -> ComponentResponse
Get the hydrated version of this component.
Returns:
| Type | Description |
|---|---|
ComponentResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/component.py
277 278 279 280 281 282 283 284 285 | |
ComponentResponseBody
ComponentResponseMetadata
ComponentResponseResources
ComponentUpdate
CuratedVisualizationRequest
Bases: ProjectScopedRequest
Request model for curated visualizations.
Each curated visualization links a pre-rendered artifact visualization to a single ZenML resource to surface it in the appropriate UI context. Supported resources include: - Deployments - Models - Pipelines - Pipeline Runs - Pipeline Snapshots - Projects
CuratedVisualizationResponse
Bases: ProjectScopedResponse[CuratedVisualizationResponseBody, CuratedVisualizationResponseMetadata, CuratedVisualizationResponseResources]
Response model for curated visualizations.
artifact_version_id: UUID
property
The artifact version ID.
Returns:
| Type | Description |
|---|---|
UUID
|
The artifact version ID if available. |
artifact_visualization: ArtifactVisualizationResponse
property
The curated artifact visualization resource.
Returns:
| Type | Description |
|---|---|
ArtifactVisualizationResponse
|
The artifact visualization resource. |
artifact_visualization_id: UUID
property
The artifact visualization ID.
Returns:
| Type | Description |
|---|---|
UUID
|
The artifact visualization ID. |
display_name: Optional[str]
property
The display name of the visualization.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The display name of the visualization. |
display_order: Optional[int]
property
The display order of the visualization.
Returns:
| Type | Description |
|---|---|
Optional[int]
|
The display order of the visualization. |
layout_size: CuratedVisualizationSize
property
The layout size of the visualization.
Returns:
| Type | Description |
|---|---|
CuratedVisualizationSize
|
The layout size of the visualization. |
resource_id: UUID
property
The identifier of the linked resource.
Returns:
| Type | Description |
|---|---|
UUID
|
The resource identifier associated with this visualization. |
resource_type: VisualizationResourceTypes
property
The type of the linked resource.
Returns:
| Type | Description |
|---|---|
VisualizationResourceTypes
|
The resource type associated with this visualization. |
get_hydrated_version() -> CuratedVisualizationResponse
Get the hydrated version of this curated visualization.
Returns:
| Type | Description |
|---|---|
CuratedVisualizationResponse
|
A hydrated instance of the same entity. |
Source code in src/zenml/models/v2/core/curated_visualization.py
188 189 190 191 192 193 194 195 196 197 | |
CuratedVisualizationResponseBody
CuratedVisualizationResponseMetadata
CuratedVisualizationResponseResources
CuratedVisualizationUpdate
DefaultComponentRequest
DefaultStackRequest
DeployedStack
Bases: BaseModel
Information about a deployed stack.
DeploymentFilter
Bases: ProjectScopedFilter, TaggableFilter
Model to enable advanced filtering of deployments.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/deployment.py
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/deployment.py
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
DeploymentOperationalState
Bases: BaseModel
Operational state of a deployment.
DeploymentRequest
DeploymentResponse
Bases: ProjectScopedResponse[DeploymentResponseBody, DeploymentResponseMetadata, DeploymentResponseResources]
Response model for deployments.
auth_key: Optional[str]
property
The auth key of the deployment.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The auth key of the deployment. |
deployer: Optional[ComponentResponse]
property
deployer_id: Optional[UUID]
property
The deployer ID.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
The deployer ID. |
deployment_metadata: Dict[str, Any]
property
The metadata of the deployment.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The metadata of the deployment. |
pipeline: Optional[PipelineResponse]
property
snapshot: Optional[PipelineSnapshotResponse]
property
The pipeline snapshot.
Returns:
| Type | Description |
|---|---|
Optional[PipelineSnapshotResponse]
|
The pipeline snapshot. |
snapshot_id: Optional[UUID]
property
The pipeline snapshot ID.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
The pipeline snapshot ID. |
stack: Optional[StackResponse]
property
status: Optional[DeploymentStatus]
property
The status of the deployment.
Returns:
| Type | Description |
|---|---|
Optional[DeploymentStatus]
|
The status of the deployment. |
url: Optional[str]
property
The URL of the deployment.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The URL of the deployment. |
visualizations: List[CuratedVisualizationResponse]
property
The visualizations of the deployment.
Returns:
| Type | Description |
|---|---|
List[CuratedVisualizationResponse]
|
The visualizations of the deployment. |
get_hydrated_version() -> DeploymentResponse
Get the hydrated version of this deployment.
Returns:
| Type | Description |
|---|---|
DeploymentResponse
|
an instance of the same entity with the metadata and resources fields |
DeploymentResponse
|
attached. |
Source code in src/zenml/models/v2/core/deployment.py
237 238 239 240 241 242 243 244 245 246 247 | |
tags() -> List[TagResponse]
The tags of the deployment.
Returns:
| Type | Description |
|---|---|
List[TagResponse]
|
The tags of the deployment. |
Source code in src/zenml/models/v2/core/deployment.py
313 314 315 316 317 318 319 | |
DeploymentResponseBody
DeploymentResponseMetadata
DeploymentResponseResources
DeploymentUpdate
Bases: BaseUpdate
Update model for deployments.
from_operational_state(operational_state: DeploymentOperationalState) -> DeploymentUpdate
classmethod
Create an update from an operational state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operational_state
|
DeploymentOperationalState
|
The operational state to create an update from. |
required |
Returns:
| Type | Description |
|---|---|
DeploymentUpdate
|
The update. |
Source code in src/zenml/models/v2/core/deployment.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
EventSourceFilter
EventSourceFlavorResponse
Bases: BasePluginFlavorResponse[EventSourceFlavorResponseBody, EventSourceFlavorResponseMetadata, EventSourceFlavorResponseResources]
Response model for Event Source Flavors.
filter_config_schema: Dict[str, Any]
property
The filter_config_schema property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
source_config_schema: Dict[str, Any]
property
The source_config_schema property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
EventSourceFlavorResponseBody
EventSourceFlavorResponseMetadata
EventSourceFlavorResponseResources
EventSourceRequest
EventSourceResponse
Bases: ProjectScopedResponse[EventSourceResponseBody, EventSourceResponseMetadata, EventSourceResponseResources]
Response model for event sources.
configuration: Dict[str, Any]
property
The configuration property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
description: str
property
The description property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
flavor: str
property
The flavor property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
is_active: bool
property
The is_active property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
plugin_subtype: PluginSubType
property
get_hydrated_version() -> EventSourceResponse
Get the hydrated version of this event source.
Returns:
| Type | Description |
|---|---|
EventSourceResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/event_source.py
161 162 163 164 165 166 167 168 169 | |
set_configuration(configuration: Dict[str, Any]) -> None
Set the configuration property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
configuration
|
Dict[str, Any]
|
The value to set. |
required |
Source code in src/zenml/models/v2/core/event_source.py
217 218 219 220 221 222 223 | |
EventSourceResponseBody
EventSourceResponseMetadata
EventSourceResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the code repository entity.
EventSourceUpdate
Bases: BaseUpdate
Update model for event sources.
from_response(response: EventSourceResponse) -> EventSourceUpdate
classmethod
Create an update model from a response model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
EventSourceResponse
|
The response model to create the update model from. |
required |
Returns:
| Type | Description |
|---|---|
EventSourceUpdate
|
The update model. |
Source code in src/zenml/models/v2/core/event_source.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
ExceptionInfo
Bases: BaseModel
Exception information.
ExternalArtifact
Bases: ExternalArtifactConfiguration
External artifacts can be used to provide values as input to ZenML steps.
ZenML steps accept either artifacts (=outputs of other steps), parameters (raw, JSON serializable values) or external artifacts. External artifacts can be used to provide any value as input to a step without needing to write an additional step that returns this value.
The external artifact needs to have a value associated with it that will be uploaded to the artifact store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
The artifact value. |
required | |
materializer
|
The materializer to use for saving the artifact value
to the artifact store. Only used when |
required | |
store_artifact_metadata
|
Whether metadata for the artifact should
be stored. Only used when |
required | |
store_artifact_visualizations
|
Whether visualizations for the
artifact should be stored. Only used when |
required |
Example:
from zenml import step, pipeline
from zenml.artifacts.external_artifact import ExternalArtifact
import numpy as np
@step
def my_step(value: np.ndarray) -> None:
print(value)
my_array = np.array([1, 2, 3])
@pipeline
def my_pipeline():
my_step(value=ExternalArtifact(my_array))
config: ExternalArtifactConfiguration
property
Returns the lightweight config without hard for JSON properties.
Returns:
| Type | Description |
|---|---|
ExternalArtifactConfiguration
|
The config object to be evaluated in runtime by step interface. |
external_artifact_validator() -> ExternalArtifact
Model validator for the external artifact.
Raises:
| Type | Description |
|---|---|
ValueError
|
If an ID was set. |
Returns:
| Type | Description |
|---|---|
ExternalArtifact
|
The validated instance. |
Source code in src/zenml/artifacts/external_artifact.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
upload_by_value() -> UUID
Uploads the artifact by value.
Returns:
| Type | Description |
|---|---|
UUID
|
The uploaded artifact ID. |
Source code in src/zenml/artifacts/external_artifact.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
ExternalUserModel
Bases: BaseModel
External user model.
FlavorFilter
FlavorRequest
FlavorResponse
Bases: UserScopedResponse[FlavorResponseBody, FlavorResponseMetadata, FlavorResponseResources]
Response model for stack component flavors.
config_schema: Dict[str, Any]
property
The config_schema property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
connector_requirements: Optional[ServiceConnectorRequirements]
property
Returns the connector requirements for the flavor.
Returns:
| Type | Description |
|---|---|
Optional[ServiceConnectorRequirements]
|
The connector requirements for the flavor. |
connector_resource_id_attr: Optional[str]
property
The connector_resource_id_attr property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
connector_resource_type: Optional[str]
property
The connector_resource_type property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
connector_type: Optional[str]
property
The connector_type property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
display_name: str
property
The display_name property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
docs_url: Optional[str]
property
The docs_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
integration: Optional[str]
property
The integration property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
is_custom: bool
property
The is_custom property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
sdk_docs_url: Optional[str]
property
The sdk_docs_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
source: str
property
The source property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
type: StackComponentType
property
get_hydrated_version() -> FlavorResponse
Get the hydrated version of the flavor.
Returns:
| Type | Description |
|---|---|
FlavorResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/flavor.py
265 266 267 268 269 270 271 272 273 | |
FlavorResponseBody
FlavorResponseMetadata
FlavorResponseResources
FlavorUpdate
LoadedVisualization
Bases: BaseModel
Model for loaded visualizations.
LogsRequest
Bases: BaseRequest
Request model for logs.
text_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum text length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
| Type | Description |
|---|---|
Any
|
the value itself. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/logs.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
LogsResponse
Bases: BaseIdentifiedResponse[LogsResponseBody, LogsResponseMetadata, LogsResponseResources]
Response model for logs.
artifact_store_id: Optional[UUID]
property
The artifact_store_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
log_store_id: Optional[UUID]
property
The log_store_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
pipeline_run_id: Optional[UUID]
property
The pipeline_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
source: str
property
The source property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
step_run_id: Optional[UUID]
property
The step_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
uri: Optional[str]
property
The uri property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
get_hydrated_version() -> LogsResponse
Get the hydrated version of these logs.
Returns:
| Type | Description |
|---|---|
LogsResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/logs.py
133 134 135 136 137 138 139 140 141 | |
LogsResponseBody
LogsResponseMetadata
Model
Bases: BaseModel
Model class to pass into pipeline or step to set it into a model context.
name: The name of the model.
license: The license under which the model is created.
description: The description of the model.
audience: The target audience of the model.
use_cases: The use cases of the model.
limitations: The known limitations of the model.
trade_offs: The tradeoffs of the model.
ethics: The ethical implications of the model.
tags: Tags associated with the model.
version: The version name, version number or stage is optional and points model context
to a specific version/stage. If skipped new version will be created. version
also supports placeholders: standard {date} and {time} and any custom placeholders
that are passed as substitutions in the pipeline or step decorators.
save_models_to_registry: Whether to save all ModelArtifacts to Model Registry,
if available in active stack.
id: UUID
property
Get version id from the Model Control Plane.
Returns:
| Type | Description |
|---|---|
UUID
|
ID of the model version or None, if model version doesn't exist and can only be read given current config (you used stage name or number as a version name). |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if model version doesn't exist and cannot be fetched from the Model Control Plane. |
model_id: UUID
property
Get model id from the Model Control Plane.
Returns:
| Type | Description |
|---|---|
UUID
|
The UUID of the model containing this model version. |
number: int
property
Get version number from the Model Control Plane.
Returns:
| Type | Description |
|---|---|
int
|
Number of the model version or None, if model version doesn't exist and can only be read given current config (you used stage name or number as a version name). |
Raises:
| Type | Description |
|---|---|
KeyError
|
if model version doesn't exist and cannot be fetched from the Model Control Plane. |
run_metadata: Dict[str, MetadataType]
property
Get model version run metadata.
Returns:
| Type | Description |
|---|---|
Dict[str, MetadataType]
|
The model version run metadata. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the model version run metadata cannot be fetched. |
stage: Optional[ModelStages]
property
Get version stage from the Model Control Plane.
Returns:
| Type | Description |
|---|---|
Optional[ModelStages]
|
Stage of the model version or None, if model version doesn't exist and can only be read given current config (you used stage name or number as a version name). |
delete_all_artifacts(only_link: bool = True, delete_from_artifact_store: bool = False) -> None
Delete all artifacts linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
only_link
|
bool
|
Whether to only delete the link to the artifact. |
True
|
delete_from_artifact_store
|
bool
|
Whether to delete the artifact from the artifact store. |
False
|
Source code in src/zenml/model/model.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |
delete_artifact(name: str, version: Optional[str] = None, only_link: bool = True, delete_metadata: bool = True, delete_from_artifact_store: bool = False) -> None
Delete the artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the artifact to delete. |
required |
version
|
Optional[str]
|
The version of the artifact to delete (None for latest/non-versioned) |
None
|
only_link
|
bool
|
Whether to only delete the link to the artifact. |
True
|
delete_metadata
|
bool
|
Whether to delete the metadata of the artifact. |
True
|
delete_from_artifact_store
|
bool
|
Whether to delete the artifact from the artifact store. |
False
|
Source code in src/zenml/model/model.py
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
get_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the artifact or placeholder in the design time of the pipeline. |
Source code in src/zenml/model/model.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |
get_data_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the data artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the data artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the data artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the data artifact or placeholder in the design |
Optional[ArtifactVersionResponse]
|
time of the pipeline. |
Source code in src/zenml/model/model.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
get_deployment_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the deployment artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the deployment artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the deployment artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the deployment artifact or placeholder in the |
Optional[ArtifactVersionResponse]
|
design time of the pipeline. |
Source code in src/zenml/model/model.py
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
get_model_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the model artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the model artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the model artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the model artifact or placeholder in the design time of the pipeline. |
Source code in src/zenml/model/model.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |
load_artifact(name: str, version: Optional[str] = None) -> Any
Load artifact from the Model Control Plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the artifact to load. |
required |
version
|
Optional[str]
|
Version of the artifact to load. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The loaded artifact. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the model version is not linked to any artifact with the given name and version. |
Source code in src/zenml/model/model.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
log_metadata(metadata: Dict[str, MetadataType]) -> None
Log model version metadata.
This function can be used to log metadata for current model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, MetadataType]
|
The metadata to log. |
required |
Source code in src/zenml/model/model.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
set_stage(stage: Union[str, ModelStages], force: bool = False) -> None
Sets this Model to a desired stage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stage
|
Union[str, ModelStages]
|
the target stage for model version. |
required |
force
|
bool
|
whether to force archiving of current model version in target stage or raise. |
False
|
Source code in src/zenml/model/model.py
306 307 308 309 310 311 312 313 314 315 316 | |
ModelFilter
Bases: ProjectScopedFilter, TaggableFilter
Model to enable advanced filtering of all models.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query for Models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/model.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
ModelRequest
ModelResponse
Bases: ProjectScopedResponse[ModelResponseBody, ModelResponseMetadata, ModelResponseResources]
Response model for models.
audience: Optional[str]
property
The audience property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
description: Optional[str]
property
The description property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
ethics: Optional[str]
property
The ethics property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
latest_version_id: Optional[UUID]
property
The latest_version_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
latest_version_name: Optional[str]
property
The latest_version_name property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
license: Optional[str]
property
The license property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
limitations: Optional[str]
property
The limitations property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
save_models_to_registry: bool
property
The save_models_to_registry property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
tags: List[TagResponse]
property
trade_offs: Optional[str]
property
The trade_offs property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
use_cases: Optional[str]
property
The use_cases property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
versions: List[Model]
property
List all versions of the model.
Returns:
| Type | Description |
|---|---|
List[Model]
|
The list of all model version. |
visualizations: List[CuratedVisualizationResponse]
property
The visualizations property.
Returns:
| Type | Description |
|---|---|
List[CuratedVisualizationResponse]
|
the value of the property. |
get_hydrated_version() -> ModelResponse
Get the hydrated version of this model.
Returns:
| Type | Description |
|---|---|
ModelResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/model.py
209 210 211 212 213 214 215 216 217 | |
ModelResponseBody
ModelResponseMetadata
ModelResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the model entity.
ModelUpdate
ModelVersionArtifactFilter
Bases: BaseFilter
Model version pipeline run links filter model.
get_custom_filters(table: Type[AnySchema]) -> List[Union[ColumnElement[bool]]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[Union[ColumnElement[bool]]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version_artifact.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
ModelVersionArtifactRequest
ModelVersionArtifactResponse
Bases: BaseIdentifiedResponse[ModelVersionArtifactResponseBody, BaseResponseMetadata, ModelVersionArtifactResponseResources]
Response model for links between model versions and artifacts.
artifact_version: ArtifactVersionResponse
property
The artifact_version property.
Returns:
| Type | Description |
|---|---|
ArtifactVersionResponse
|
the value of the property. |
model_version: UUID
property
The model_version property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
ModelVersionArtifactResponseBody
ModelVersionFilter
Bases: ProjectScopedFilter, TaggableFilter, RunMetadataFilterMixin
Filter model for model versions.
get_custom_filters(table: Type[AnySchema]) -> List[Union[ColumnElement[bool]]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[Union[ColumnElement[bool]]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version.py
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
ModelVersionIdentifier
ModelVersionPipelineRunFilter
Bases: BaseFilter
Model version pipeline run links filter model.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version_pipeline_run.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
ModelVersionPipelineRunRequest
ModelVersionPipelineRunResponse
Bases: BaseIdentifiedResponse[ModelVersionPipelineRunResponseBody, BaseResponseMetadata, ModelVersionPipelineRunResponseResources]
Response model for links between model versions and pipeline runs.
model_version: UUID
property
The model_version property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
pipeline_run: PipelineRunResponse
property
ModelVersionPipelineRunResponseBody
ModelVersionRequest
ModelVersionResponse
Bases: ProjectScopedResponse[ModelVersionResponseBody, ModelVersionResponseMetadata, ModelVersionResponseResources]
Response model for model versions.
data_artifact_ids: Dict[str, Dict[str, UUID]]
property
Data artifacts linked to this model version.
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, UUID]]
|
Data artifacts linked to this model version. |
data_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all data artifacts linked to this model version.
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of data artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
deployment_artifact_ids: Dict[str, Dict[str, UUID]]
property
Deployment artifacts linked to this model version.
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, UUID]]
|
Deployment artifacts linked to this model version. |
deployment_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all deployment artifacts linked to this model version.
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of deployment artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
description: Optional[str]
property
The description property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
model: ModelResponse
property
model_artifact_ids: Dict[str, Dict[str, UUID]]
property
Model artifacts linked to this model version.
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, UUID]]
|
Model artifacts linked to this model version. |
model_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all model artifacts linked to this model version.
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of model artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
number: int
property
The number property.
Returns:
| Type | Description |
|---|---|
int
|
the value of the property. |
pipeline_run_ids: Dict[str, UUID]
property
Pipeline runs linked to this model version.
Returns:
| Type | Description |
|---|---|
Dict[str, UUID]
|
Pipeline runs linked to this model version. |
pipeline_runs: Dict[str, PipelineRunResponse]
property
Get all pipeline runs linked to this version.
Returns:
| Type | Description |
|---|---|
Dict[str, PipelineRunResponse]
|
Dictionary of Pipeline Runs as PipelineRunResponseModel |
run_metadata: Dict[str, MetadataType]
property
The run_metadata property.
Returns:
| Type | Description |
|---|---|
Dict[str, MetadataType]
|
the value of the property. |
stage: Optional[str]
property
The stage property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
tags: List[TagResponse]
property
get_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of an artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | |
get_data_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the data artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the data artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the data artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the data artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | |
get_deployment_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the deployment artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the deployment artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the deployment artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the deployment artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | |
get_hydrated_version() -> ModelVersionResponse
Get the hydrated version of this model version.
Returns:
| Type | Description |
|---|---|
ModelVersionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/model_version.py
263 264 265 266 267 268 269 270 271 | |
get_model_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the model artifact linked to this model version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the model artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the model artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the model artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 | |
set_stage(stage: Union[str, ModelStages], force: bool = False) -> None
Sets this Model Version to a desired stage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stage
|
Union[str, ModelStages]
|
the target stage for model version. |
required |
force
|
bool
|
whether to force archiving of current model version in target stage or raise. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
if model_stage is not valid. |
Source code in src/zenml/models/v2/core/model_version.py
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | |
to_model_class(suppress_class_validation_warnings: bool = True) -> Model
Convert response model to Model object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
suppress_class_validation_warnings
|
bool
|
internally used to suppress repeated warnings. |
True
|
Returns:
| Type | Description |
|---|---|
Model
|
Model object |
Source code in src/zenml/models/v2/core/model_version.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
ModelVersionResponseBody
ModelVersionResponseMetadata
ModelVersionResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the model version entity.
ModelVersionUpdate
NumericFilter
Bases: Filter
Filter for all numeric fields.
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a numeric column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column
|
Any
|
The numeric column of an SQLModel table on which to filter. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | |
OAuthDeviceAuthorizationRequest
Bases: BaseModel
OAuth2 device authorization grant request.
OAuthDeviceAuthorizationResponse
Bases: BaseModel
OAuth2 device authorization grant response.
OAuthDeviceFilter
OAuthDeviceInternalRequest
OAuthDeviceInternalResponse
Bases: OAuthDeviceResponse
OAuth2 device response model used internally for authentication.
verify_device_code(device_code: str) -> bool
Verifies a given device code against the stored (hashed) device code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_code
|
str
|
The device code to verify. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the device code is valid, False otherwise. |
Source code in src/zenml/models/v2/core/device.py
423 424 425 426 427 428 429 430 431 432 433 434 435 | |
verify_user_code(user_code: str) -> bool
Verifies a given user code against the stored (hashed) user code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_code
|
str
|
The user code to verify. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the user code is valid, False otherwise. |
Source code in src/zenml/models/v2/core/device.py
409 410 411 412 413 414 415 416 417 418 419 420 421 | |
OAuthDeviceInternalUpdate
OAuthDeviceResponse
Bases: UserScopedResponse[OAuthDeviceResponseBody, OAuthDeviceResponseMetadata, OAuthDeviceResponseResources]
Response model for OAuth2 devices.
city: Optional[str]
property
The city property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
client_id: UUID
property
The client_id property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
country: Optional[str]
property
The country property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
expires: Optional[datetime]
property
The expires property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
failed_auth_attempts: int
property
The failed_auth_attempts property.
Returns:
| Type | Description |
|---|---|
int
|
the value of the property. |
hostname: Optional[str]
property
The hostname property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
ip_address: Optional[str]
property
The ip_address property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
last_login: Optional[datetime]
property
The last_login property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
os: Optional[str]
property
The os property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
python_version: Optional[str]
property
The python_version property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
region: Optional[str]
property
The region property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
status: OAuthDeviceStatus
property
trusted_device: bool
property
The trusted_device property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
zenml_version: Optional[str]
property
The zenml_version property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
get_hydrated_version() -> OAuthDeviceResponse
Get the hydrated version of this OAuth2 device.
Returns:
| Type | Description |
|---|---|
OAuthDeviceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/device.py
240 241 242 243 244 245 246 247 248 | |
OAuthDeviceResponseBody
OAuthDeviceResponseMetadata
OAuthDeviceResponseResources
Bases: UserScopedResponseResources
Class for all resource models associated with the OAuthDevice entity.
OAuthDeviceTokenRequest
Bases: BaseModel
OAuth2 device authorization grant request.
OAuthDeviceUpdate
OAuthDeviceUserAgentHeader
Bases: BaseModel
OAuth2 device user agent header.
decode(header_str: str) -> OAuthDeviceUserAgentHeader
classmethod
Decode the user agent header.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
header_str
|
str
|
The user agent header string value. |
required |
Returns:
| Type | Description |
|---|---|
OAuthDeviceUserAgentHeader
|
The decoded user agent header. |
Source code in src/zenml/models/v2/misc/auth_models.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
encode() -> str
Encode the user agent header.
Returns:
| Type | Description |
|---|---|
str
|
The encoded user agent header. |
Source code in src/zenml/models/v2/misc/auth_models.py
85 86 87 88 89 90 91 92 93 94 95 96 | |
OAuthDeviceVerificationRequest
Bases: BaseModel
OAuth2 device authorization verification request.
OAuthRedirectResponse
Bases: BaseModel
Redirect response.
OAuthTokenResponse
Bases: BaseModel
OAuth2 device authorization token response.
Page
Bases: BaseModel, Generic[B]
Return Model for List Models to accommodate pagination.
size: int
property
Return the item count of the page.
Returns:
| Type | Description |
|---|---|
int
|
The amount of items in the page. |
PipelineBuildBase
Bases: BaseZenModel
Base model for pipeline builds.
requires_code_download: bool
property
Whether the build requires code download.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the build requires code download. |
get_image(component_key: str, step: Optional[str] = None) -> str
Get the image built for a specific key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_key
|
str
|
The key for which to get the image. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the image. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The image name or digest. |
Source code in src/zenml/models/v2/core/pipeline_build.py
107 108 109 110 111 112 113 114 115 116 117 118 119 | |
get_image_key(component_key: str, step: Optional[str] = None) -> str
staticmethod
Get the image key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_key
|
str
|
The component key. |
required |
step
|
Optional[str]
|
The pipeline step for which the image was built. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The image key. |
Source code in src/zenml/models/v2/core/pipeline_build.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
get_settings_checksum(component_key: str, step: Optional[str] = None) -> Optional[str]
Get the settings checksum for a specific key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_key
|
str
|
The key for which to get the checksum. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the checksum. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The settings checksum. |
Source code in src/zenml/models/v2/core/pipeline_build.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
PipelineBuildFilter
Bases: ProjectScopedFilter
Model to enable advanced filtering of all pipeline builds.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/pipeline_build.py
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | |
PipelineBuildRequest
PipelineBuildResponse
Bases: ProjectScopedResponse[PipelineBuildResponseBody, PipelineBuildResponseMetadata, PipelineBuildResponseResources]
Response model for pipeline builds.
checksum: Optional[str]
property
The checksum property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
contains_code: bool
property
The contains_code property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
duration: Optional[int]
property
The duration property.
Returns:
| Type | Description |
|---|---|
Optional[int]
|
the value of the property. |
images: Dict[str, BuildItem]
property
is_local: bool
property
The is_local property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineResponse]
|
the value of the property. |
python_version: Optional[str]
property
The python_version property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
requires_code_download: bool
property
Whether the build requires code download.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the build requires code download. |
stack: Optional[StackResponse]
property
stack_checksum: Optional[str]
property
The stack_checksum property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
zenml_version: Optional[str]
property
The zenml_version property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
get_hydrated_version() -> PipelineBuildResponse
Return the hydrated version of this pipeline build.
Returns:
| Type | Description |
|---|---|
PipelineBuildResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_build.py
251 252 253 254 255 256 257 258 259 | |
get_image(component_key: str, step: Optional[str] = None) -> str
Get the image built for a specific key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_key
|
str
|
The key for which to get the image. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the image. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The image name or digest. |
Source code in src/zenml/models/v2/core/pipeline_build.py
319 320 321 322 323 324 325 326 327 328 329 330 331 | |
get_image_key(component_key: str, step: Optional[str] = None) -> str
staticmethod
Get the image key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_key
|
str
|
The component key. |
required |
step
|
Optional[str]
|
The pipeline step for which the image was built. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The image key. |
Source code in src/zenml/models/v2/core/pipeline_build.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
get_settings_checksum(component_key: str, step: Optional[str] = None) -> Optional[str]
Get the settings checksum for a specific key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_key
|
str
|
The key for which to get the checksum. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the checksum. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The settings checksum. |
Source code in src/zenml/models/v2/core/pipeline_build.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | |
to_yaml() -> Dict[str, Any]
Create a yaml representation of the pipeline build.
Create a yaml representation of the pipeline build that can be used to create a PipelineBuildBase instance.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The yaml representation of the pipeline build. |
Source code in src/zenml/models/v2/core/pipeline_build.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
PipelineBuildResponseBody
PipelineBuildResponseMetadata
PipelineBuildResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the pipeline build entity.
PipelineFilter
Bases: ProjectScopedFilter, TaggableFilter
Pipeline filter model.
filter_by_latest_execution: bool
property
Property returning whether filtering considers latest pipeline execution.
Returns:
| Type | Description |
|---|---|
bool
|
True if latest pipeline execution filters are used (e.g. latest_run_status). |
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/pipeline.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/pipeline.py
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
PipelineRequest
PipelineResponse
Bases: ProjectScopedResponse[PipelineResponseBody, PipelineResponseMetadata, PipelineResponseResources]
Response model for pipelines.
last_run: PipelineRunResponse
property
Returns the last run of this pipeline.
Returns:
| Type | Description |
|---|---|
PipelineRunResponse
|
The last run of this pipeline. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no runs were found for this pipeline. |
last_successful_run: PipelineRunResponse
property
Returns the last successful run of this pipeline.
Returns:
| Type | Description |
|---|---|
PipelineRunResponse
|
The last successful run of this pipeline. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no successful runs were found for this pipeline. |
latest_run_id: Optional[UUID]
property
The latest_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
latest_run_status: Optional[ExecutionStatus]
property
The latest_run_status property.
Returns:
| Type | Description |
|---|---|
Optional[ExecutionStatus]
|
the value of the property. |
num_runs: int
property
Returns the number of runs of this pipeline.
Returns:
| Type | Description |
|---|---|
int
|
The number of runs of this pipeline. |
runs: List[PipelineRunResponse]
property
Returns the 20 most recent runs of this pipeline in descending order.
Returns:
| Type | Description |
|---|---|
List[PipelineRunResponse]
|
The 20 most recent runs of this pipeline in descending order. |
tags: List[TagResponse]
property
get_hydrated_version() -> PipelineResponse
Get the hydrated version of this pipeline.
Returns:
| Type | Description |
|---|---|
PipelineResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline.py
154 155 156 157 158 159 160 161 162 | |
get_runs(**kwargs: Any) -> List[PipelineRunResponse]
Get runs of this pipeline.
Can be used to fetch runs other than self.runs and supports
fine-grained filtering and pagination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Any
|
Further arguments for filtering or pagination that are
passed to |
{}
|
Returns:
| Type | Description |
|---|---|
List[PipelineRunResponse]
|
List of runs of this pipeline. |
Source code in src/zenml/models/v2/core/pipeline.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
PipelineResponseBody
PipelineResponseMetadata
PipelineResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the pipeline entity.
PipelineRunDAG
Bases: BaseModel
Pipeline run DAG.
Edge
Bases: BaseModel
Edge in the pipeline run DAG.
Node
Bases: BaseModel
Node in the pipeline run DAG.
PipelineRunFilter
Bases: ProjectScopedFilter, TaggableFilter, RunMetadataFilterMixin
Model to enable advanced filtering of all pipeline runs.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/pipeline_run.py
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 | |
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/pipeline_run.py
845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 | |
PipelineRunIdentifier
Bases: BaseModel
Class grouping different pipeline run identifiers.
value: str | UUID
property
Resolves the set value out of id, name, prefix etc.
Returns:
| Type | Description |
|---|---|
str | UUID
|
The id/name/prefix (if set, in this exact order). |
PipelineRunRequest
Bases: ProjectScopedRequest
Request model for pipeline runs.
is_placeholder_request: bool
property
Whether the request is a placeholder request.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the request is a placeholder request. |
PipelineRunResponse
Bases: ProjectScopedResponse[PipelineRunResponseBody, PipelineRunResponseMetadata, PipelineRunResponseResources]
Response model for pipeline runs.
artifact_versions: List[ArtifactVersionResponse]
property
Get all artifact versions that are outputs of steps of this run.
Returns:
| Type | Description |
|---|---|
List[ArtifactVersionResponse]
|
All output artifact versions of this run (including cached ones). |
build: Optional[PipelineBuildResponse]
property
The build property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
client_environment: Dict[str, Any]
property
The client_environment property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
code_path: Optional[str]
property
The code_path property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The schedule property.
Returns:
| Type | Description |
|---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
config: PipelineConfiguration
property
enable_heartbeat: bool
property
The enable_heartbeat property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
exception_info: Optional[ExceptionInfo]
property
The exception_info property.
Returns:
| Type | Description |
|---|---|
Optional[ExceptionInfo]
|
the value of the property. |
in_progress: bool
property
The in_progress property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
index: int
property
The index property.
Returns:
| Type | Description |
|---|---|
int
|
the value of the property. |
is_templatable: bool
property
The is_templatable property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
log_collection: Optional[List[LogsResponse]]
property
The log_collection property.
Returns:
| Type | Description |
|---|---|
Optional[List[LogsResponse]]
|
the value of the property. |
model_version: Optional[ModelVersionResponse]
property
The model_version property.
Returns:
| Type | Description |
|---|---|
Optional[ModelVersionResponse]
|
the value of the property. |
orchestrator_environment: Dict[str, Any]
property
The orchestrator_environment property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
orchestrator_run_id: Optional[str]
property
The orchestrator_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineResponse]
|
the value of the property. |
produced_artifact_versions: List[ArtifactVersionResponse]
property
Get all artifact versions produced during this pipeline run.
Returns:
| Type | Description |
|---|---|
List[ArtifactVersionResponse]
|
A list of all artifact versions produced during this pipeline run. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata property.
Returns:
| Type | Description |
|---|---|
Dict[str, MetadataType]
|
the value of the property. |
schedule: Optional[ScheduleResponse]
property
The schedule property.
Returns:
| Type | Description |
|---|---|
Optional[ScheduleResponse]
|
the value of the property. |
snapshot: Optional[PipelineSnapshotResponse]
property
The snapshot property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineSnapshotResponse]
|
the value of the property. |
source_snapshot: Optional[PipelineSnapshotResponse]
property
The source_snapshot property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineSnapshotResponse]
|
the value of the property. |
stack: Optional[StackResponse]
property
start_time: Optional[datetime]
property
The start_time property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
status: ExecutionStatus
property
steps: Dict[str, StepRunResponse]
property
tags: List[TagResponse]
property
template_id: Optional[UUID]
property
The template_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
trigger_execution: Optional[TriggerExecutionResponse]
property
The trigger_execution property.
Returns:
| Type | Description |
|---|---|
Optional[TriggerExecutionResponse]
|
the value of the property. |
trigger_info: Optional[PipelineRunTriggerInfo]
property
The trigger_info property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineRunTriggerInfo]
|
the value of the property. |
triggered_by_deployment: bool
property
The triggered_by_deployment property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
get_hydrated_version() -> PipelineRunResponse
Get the hydrated version of this pipeline run.
Returns:
| Type | Description |
|---|---|
PipelineRunResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_run.py
358 359 360 361 362 363 364 365 366 | |
PipelineRunResponseBody
PipelineRunResponseMetadata
PipelineRunResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the pipeline run entity.
PipelineRunTriggerInfo
PipelineRunUpdate
PipelineSnapshotBase
PipelineSnapshotFilter
Bases: ProjectScopedFilter, TaggableFilter
Model for filtering pipeline snapshots.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/pipeline_snapshot.py
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 | |
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/pipeline_snapshot.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 | |
PipelineSnapshotRequest
PipelineSnapshotResponse
Bases: ProjectScopedResponse[PipelineSnapshotResponseBody, PipelineSnapshotResponseMetadata, PipelineSnapshotResponseResources]
Response model for pipeline snapshots.
build: Optional[PipelineBuildResponse]
property
The build property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
client_environment: Dict[str, Any]
property
The client_environment property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
client_version: Optional[str]
property
The client_version property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
code_path: Optional[str]
property
The code_path property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The code_reference property.
Returns:
| Type | Description |
|---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
config_schema: Optional[Dict[str, Any]]
property
The config_schema property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
config_template: Optional[Dict[str, Any]]
property
The config_template property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
deployable: bool
property
The deployable property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
deployment: Optional[DeploymentResponse]
property
The deployment property.
Returns:
| Type | Description |
|---|---|
Optional[DeploymentResponse]
|
the value of the property. |
description: Optional[str]
property
The description property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
is_dynamic: bool
property
The is_dynamic property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
latest_run_id: Optional[UUID]
property
The latest_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
latest_run_status: Optional[ExecutionStatus]
property
The latest_run_status property.
Returns:
| Type | Description |
|---|---|
Optional[ExecutionStatus]
|
the value of the property. |
latest_run_user: Optional[UserResponse]
property
The latest_run_user property.
Returns:
| Type | Description |
|---|---|
Optional[UserResponse]
|
the value of the property. |
pipeline: PipelineResponse
property
pipeline_configuration: PipelineConfiguration
property
The pipeline_configuration property.
Returns:
| Type | Description |
|---|---|
PipelineConfiguration
|
the value of the property. |
pipeline_spec: Optional[PipelineSpec]
property
The pipeline_spec property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineSpec]
|
the value of the property. |
pipeline_version_hash: Optional[str]
property
The pipeline_version_hash property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
run_name_template: str
property
The run_name_template property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
runnable: bool
property
The runnable property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
schedule: Optional[ScheduleResponse]
property
The schedule property.
Returns:
| Type | Description |
|---|---|
Optional[ScheduleResponse]
|
the value of the property. |
server_version: Optional[str]
property
The server_version property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
source_code: Optional[str]
property
The source_code property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
source_snapshot_id: Optional[UUID]
property
The source_snapshot_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
stack: Optional[StackResponse]
property
step_configurations: Dict[str, Step]
property
The step_configurations property.
Returns:
| Type | Description |
|---|---|
Dict[str, Step]
|
the value of the property. |
tags: List[TagResponse]
property
template_id: Optional[UUID]
property
The template_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
get_hydrated_version() -> PipelineSnapshotResponse
Return the hydrated version of this pipeline snapshot.
Returns:
| Type | Description |
|---|---|
PipelineSnapshotResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_snapshot.py
367 368 369 370 371 372 373 374 375 | |
PipelineSnapshotResponseBody
PipelineSnapshotResponseMetadata
PipelineSnapshotResponseResources
PipelineSnapshotRunRequest
PipelineSnapshotUpdate
PipelineUpdate
ProjectFilter
ProjectRequest
ProjectResponse
Bases: BaseIdentifiedResponse[ProjectResponseBody, ProjectResponseMetadata, ProjectResponseResources]
Response model for projects.
description: str
property
The description property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
display_name: str
property
The display_name property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
get_hydrated_version() -> ProjectResponse
Get the hydrated version of this project.
Returns:
| Type | Description |
|---|---|
ProjectResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/project.py
158 159 160 161 162 163 164 165 166 | |
ProjectResponseBody
ProjectResponseMetadata
ProjectScopedFilter
Bases: UserScopedFilter
Model to enable advanced scoping with project.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the project scope is missing from the filter. |
Source code in src/zenml/models/v2/base/scoped.py
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
ProjectScopedRequest
Bases: UserScopedRequest
Base project-scoped request domain model.
Used as a base class for all domain models that are project-scoped.
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for project scoped models.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
91 92 93 94 95 96 97 98 99 | |
ProjectScopedResponse
Bases: UserScopedResponse[ProjectBody, ProjectMetadata, ProjectResources], Generic[ProjectBody, ProjectMetadata, ProjectResources]
Base project-scoped domain model.
Used as a base class for all domain models that are project-scoped.
project: ProjectResponse
property
project_id: UUID
property
The project ID property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for project scoped models.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
333 334 335 336 337 338 339 340 341 | |
ProjectScopedResponseBody
ProjectScopedResponseMetadata
ProjectScopedResponseResources
ProjectStatistics
ProjectUpdate
ResourceTypeModel
Bases: BaseModel
Resource type specification.
Describes the authentication methods and resource instantiation model for one or more resource types.
emojified_resource_type: str
property
Get the emojified resource type.
Returns:
| Type | Description |
|---|---|
str
|
The emojified resource type. |
ResourcesInfo
Bases: BaseModel
Information about the resources needed for CLI and UI.
RunMetadataEntry
Bases: BaseModel
Utility class to sort/list run metadata entries.
RunMetadataFilterMixin
Bases: BaseFilter
Model to enable filtering and sorting by run metadata.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom run metadata filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | |
validate_run_metadata_format() -> RunMetadataFilterMixin
Validates that run_metadata entries are in the correct format.
Each run_metadata entry must be in one of the following formats: 1. "key:value" - Direct equality comparison (key equals value) 2. "key:filterop:value" - Where filterop is one of the GenericFilterOps: - equals: Exact match - notequals: Not equal to - contains: String contains value - startswith: String starts with value - endswith: String ends with value - oneof: Value is one of the specified options - gte: Greater than or equal to - gt: Greater than - lte: Less than or equal to - lt: Less than - in: Value is in a list
Examples: - "status:completed" - Find entries where status equals "completed" - "name:contains:test" - Find entries where name contains "test" - "duration:gt:10" - Find entries where duration is greater than 10
Returns:
| Type | Description |
|---|---|
RunMetadataFilterMixin
|
self |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any entry in run_metadata does not contain a colon. |
Source code in src/zenml/models/v2/base/scoped.py
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | |
RunMetadataRequest
Bases: ProjectScopedRequest
Request model for run metadata.
validate_values_keys() -> RunMetadataRequest
Validates if the keys in the metadata are properly defined.
Returns:
| Type | Description |
|---|---|
RunMetadataRequest
|
self |
Raises:
| Type | Description |
|---|---|
ValueError
|
if one of the key in the metadata contains |
Source code in src/zenml/models/v2/core/run_metadata.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
RunMetadataResource
Bases: BaseModel
Utility class to help identify resources to tag metadata to.
RunTemplateFilter
Bases: ProjectScopedFilter, TaggableFilter
Model for filtering of run templates.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/run_template.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | |
RunTemplateRequest
RunTemplateResponse
Bases: ProjectScopedResponse[RunTemplateResponseBody, RunTemplateResponseMetadata, RunTemplateResponseResources]
Response model for run templates.
build: Optional[PipelineBuildResponse]
property
The build property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The code_reference property.
Returns:
| Type | Description |
|---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
config_schema: Optional[Dict[str, Any]]
property
The config_schema property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
config_template: Optional[Dict[str, Any]]
property
The config_template property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
description: Optional[str]
property
The description property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
The hidden property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
latest_run_id: Optional[UUID]
property
The latest_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
latest_run_status: Optional[ExecutionStatus]
property
The latest_run_status property.
Returns:
| Type | Description |
|---|---|
Optional[ExecutionStatus]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineResponse]
|
the value of the property. |
pipeline_spec: Optional[PipelineSpec]
property
The pipeline_spec property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineSpec]
|
the value of the property. |
runnable: bool
property
The runnable property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
source_snapshot: Optional[PipelineSnapshotResponse]
property
The source_snapshot property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineSnapshotResponse]
|
the value of the property. |
tags: List[TagResponse]
property
get_hydrated_version() -> RunTemplateResponse
Return the hydrated version of this run template.
Returns:
| Type | Description |
|---|---|
RunTemplateResponse
|
The hydrated run template. |
Source code in src/zenml/models/v2/core/run_template.py
198 199 200 201 202 203 204 205 206 207 208 | |
RunTemplateResponseBody
RunTemplateResponseMetadata
RunTemplateResponseResources
RunTemplateUpdate
ScheduleFilter
ScheduleRequest
ScheduleResponse
Bases: ProjectScopedResponse[ScheduleResponseBody, ScheduleResponseMetadata, ScheduleResponseResources]
Response model for schedules.
active: bool
property
The active property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
catchup: bool
property
The catchup property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
cron_expression: Optional[str]
property
The cron_expression property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
interval_second: Optional[timedelta]
property
The interval_second property.
Returns:
| Type | Description |
|---|---|
Optional[timedelta]
|
the value of the property. |
is_archived: bool
property
The is_archived property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
orchestrator_id: Optional[UUID]
property
The orchestrator_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
pipeline_id: Optional[UUID]
property
The pipeline_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata property.
Returns:
| Type | Description |
|---|---|
Dict[str, MetadataType]
|
the value of the property. |
run_once_start_time: Optional[datetime]
property
The run_once_start_time property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
start_time: Optional[datetime]
property
The start_time property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
utc_end_time: Optional[str]
property
Optional ISO-formatted string of the UTC end time.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Optional ISO-formatted string of the UTC end time. |
utc_start_time: Optional[str]
property
Optional ISO-formatted string of the UTC start time.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Optional ISO-formatted string of the UTC start time. |
get_hydrated_version() -> ScheduleResponse
Get the hydrated version of this schedule.
Returns:
| Type | Description |
|---|---|
ScheduleResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/schedule.py
180 181 182 183 184 185 186 187 188 | |
ScheduleResponseBody
ScheduleResponseMetadata
ScheduleResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the schedule entity.
ScheduleUpdate
SecretFilter
Bases: UserScopedFilter
Model to enable advanced secret filtering.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/secret.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
SecretRequest
Bases: UserScopedRequest
Request model for secrets.
secret_values: Dict[str, str]
property
A dictionary with all un-obfuscated values stored in this secret.
The values are returned as strings, not SecretStr. If a value is None, it is not included in the returned dictionary. This is to enable the use of None values in the update model to indicate that a secret value should be deleted.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
A dictionary containing the secret's values. |
SecretResponse
Bases: UserScopedResponse[SecretResponseBody, SecretResponseMetadata, SecretResponseResources]
Response model for secrets.
has_missing_values: bool
property
Returns True if the secret has missing values (i.e. None).
Values can be missing from a secret for example if the user retrieves a secret but does not have the permission to view the secret values.
Returns:
| Type | Description |
|---|---|
bool
|
True if the secret has any values set to None. |
private: bool
property
The private property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
secret_values: Dict[str, str]
property
A dictionary with all un-obfuscated values stored in this secret.
The values are returned as strings, not SecretStr. If a value is None, it is not included in the returned dictionary. This is to enable the use of None values in the update model to indicate that a secret value should be deleted.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
A dictionary containing the secret's values. |
values: Dict[str, Optional[SecretStr]]
property
The values property.
Returns:
| Type | Description |
|---|---|
Dict[str, Optional[SecretStr]]
|
the value of the property. |
add_secret(key: str, value: str) -> None
Adds a secret value to the secret.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The key of the secret value. |
required |
value
|
str
|
The secret value. |
required |
Source code in src/zenml/models/v2/core/secret.py
225 226 227 228 229 230 231 232 | |
get_hydrated_version() -> SecretResponse
Get the hydrated version of this secret.
Returns:
| Type | Description |
|---|---|
SecretResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/secret.py
164 165 166 167 168 169 170 171 172 | |
remove_secret(key: str) -> None
Removes a secret value from the secret.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The key of the secret value. |
required |
Source code in src/zenml/models/v2/core/secret.py
234 235 236 237 238 239 240 | |
remove_secrets() -> None
Removes all secret values from the secret but keep the keys.
Source code in src/zenml/models/v2/core/secret.py
242 243 244 | |
set_secrets(values: Dict[str, str]) -> None
Sets the secret values of the secret.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
Dict[str, str]
|
The secret values to set. |
required |
Source code in src/zenml/models/v2/core/secret.py
246 247 248 249 250 251 252 | |
SecretResponseBody
SecretResponseMetadata
SecretResponseResources
SecretUpdate
Bases: BaseUpdate
Update model for secrets.
get_secret_values_update() -> Dict[str, Optional[str]]
Returns a dictionary with the secret values to update.
Returns:
| Type | Description |
|---|---|
Dict[str, Optional[str]]
|
A dictionary with the secret values to update. |
Source code in src/zenml/models/v2/core/secret.py
109 110 111 112 113 114 115 116 117 118 119 120 121 | |
ServerActivationRequest
ServerDatabaseType
ServerDeploymentType
ServerLoadInfo
Bases: BaseModel
Domain model for ZenML server load information.
ServerModel
Bases: BaseModel
Domain model for ZenML servers.
is_local() -> bool
Return whether the server is running locally.
Returns:
| Type | Description |
|---|---|
bool
|
True if the server is running locally, False otherwise. |
Source code in src/zenml/models/v2/misc/server_models.py
146 147 148 149 150 151 152 153 154 155 156 | |
is_pro_server() -> bool
Return whether the server is a ZenML Pro server.
Returns:
| Type | Description |
|---|---|
bool
|
True if the server is a ZenML Pro server, False otherwise. |
Source code in src/zenml/models/v2/misc/server_models.py
158 159 160 161 162 163 164 | |
ServerSettingsResponse
Bases: BaseResponse[ServerSettingsResponseBody, ServerSettingsResponseMetadata, ServerSettingsResponseResources]
Response model for server settings.
active: bool
property
The active property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
display_announcements: Optional[bool]
property
The display_announcements property.
Returns:
| Type | Description |
|---|---|
Optional[bool]
|
the value of the property. |
display_updates: Optional[bool]
property
The display_updates property.
Returns:
| Type | Description |
|---|---|
Optional[bool]
|
the value of the property. |
enable_analytics: bool
property
The enable_analytics property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
last_user_activity: datetime
property
The last_user_activity property.
Returns:
| Type | Description |
|---|---|
datetime
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
server_id: UUID
property
The server_id property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
server_name: str
property
The server_name property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
updated: datetime
property
The updated property.
Returns:
| Type | Description |
|---|---|
datetime
|
the value of the property. |
get_hydrated_version() -> ServerSettingsResponse
Get the hydrated version of the server settings.
Returns:
| Type | Description |
|---|---|
ServerSettingsResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/server_settings.py
110 111 112 113 114 115 116 117 118 | |
ServerSettingsResponseBody
ServerSettingsResponseMetadata
ServerSettingsResponseResources
ServerSettingsUpdate
ServerStatistics
ServiceAccountFilter
Bases: BaseFilter
Model to enable advanced filtering of service accounts.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to filter out user accounts from the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/service_account.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | |
ServiceAccountInternalRequest
ServiceAccountInternalUpdate
ServiceAccountRequest
ServiceAccountResponse
Bases: BaseIdentifiedResponse[ServiceAccountResponseBody, ServiceAccountResponseMetadata, ServiceAccountResponseResources]
Response model for service accounts.
active: bool
property
The active property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
avatar_url: Optional[str]
property
The avatar_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
description: str
property
The description property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
external_user_id: Optional[UUID]
property
The external_user_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
full_name: str
property
The full_name property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
get_hydrated_version() -> ServiceAccountResponse
Get the hydrated version of this service account.
Returns:
| Type | Description |
|---|---|
ServiceAccountResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service_account.py
178 179 180 181 182 183 184 185 186 | |
to_user_model() -> UserResponse
Converts the service account to a user model.
For now, a lot of code still relies on the active user and resource owners being a UserResponse object, which is a superset of the ServiceAccountResponse object. We need this method to convert the service account to a user.
Returns:
| Type | Description |
|---|---|
UserResponse
|
The user model. |
Source code in src/zenml/models/v2/core/service_account.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
ServiceAccountResponseBody
ServiceAccountResponseMetadata
ServiceAccountUpdate
ServiceConnectorConfiguration
Bases: Dict[str, Any]
Model for service connector configuration.
non_secrets: Dict[str, Any]
property
Get the non-secrets from the configuration.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
A dictionary of non-secrets. |
plain: Dict[str, Any]
property
Get the configuration with secrets unpacked.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
A dictionary of configuration with secrets unpacked. |
plain_secrets: Dict[str, str]
property
Get the plain secrets from the configuration.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
A dictionary of secrets. |
secrets: Dict[str, PlainSerializedSecretStr]
property
Get the secrets from the configuration.
Returns:
| Type | Description |
|---|---|
Dict[str, PlainSerializedSecretStr]
|
A dictionary of secrets. |
add_secrets(secrets: Dict[str, str]) -> None
Add the secrets to the configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
secrets
|
Dict[str, str]
|
The secrets to add to the configuration. |
required |
Source code in src/zenml/models/v2/core/service_connector.py
125 126 127 128 129 130 131 | |
from_dict(data: Dict[str, Any]) -> ServiceConnectorConfiguration
classmethod
Create a configuration model from a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dict[str, Any]
|
The dictionary to create the configuration model from. |
required |
Returns:
| Type | Description |
|---|---|
ServiceConnectorConfiguration
|
A configuration model. |
Source code in src/zenml/models/v2/core/service_connector.py
53 54 55 56 57 58 59 60 61 62 63 64 65 | |
get_plain(key: str, default: Any = None) -> Any
Get the plain value for the given key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The key to get the value for. |
required |
default
|
Any
|
The default value to return if the key is not found. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The plain value for the given key. |
Source code in src/zenml/models/v2/core/service_connector.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
ServiceConnectorFilter
Bases: UserScopedFilter
Model to enable advanced filtering of service connectors.
validate_labels() -> ServiceConnectorFilter
Parse the labels string into a label dictionary and vice-versa.
Returns:
| Type | Description |
|---|---|
ServiceConnectorFilter
|
The validated values. |
Source code in src/zenml/models/v2/core/service_connector.py
924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 | |
ServiceConnectorInfo
Bases: BaseModel
Information about the service connector when creating a full stack.
ServiceConnectorRequest
Bases: UserScopedRequest
Request model for service connectors.
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
| Type | Description |
|---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector type.
Returns:
| Type | Description |
|---|---|
List[str]
|
The emojified connector type. |
type: str
property
Get the connector type.
Returns:
| Type | Description |
|---|---|
str
|
The connector type. |
get_analytics_metadata() -> Dict[str, Any]
Format the resource types in the analytics metadata.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
236 237 238 239 240 241 242 243 244 245 246 247 248 | |
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | |
ServiceConnectorRequirements
Bases: BaseModel
Service connector requirements.
Describes requirements that a service connector consumer has for a service connector instance that it needs in order to access a resource.
Attributes:
| Name | Type | Description |
|---|---|---|
connector_type |
Optional[str]
|
The type of service connector that is required. If omitted, any service connector type can be used. |
resource_type |
str
|
The type of resource that the service connector instance must be able to access. |
resource_id_attr |
Optional[str]
|
The name of an attribute in the stack component configuration that contains the resource ID of the resource that the service connector instance must be able to access. |
is_satisfied_by(connector: Union[ServiceConnectorResponse, ServiceConnectorRequest], component: Union[ComponentResponse, ComponentBase]) -> Tuple[bool, str]
Check if the requirements are satisfied by a connector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connector
|
Union[ServiceConnectorResponse, ServiceConnectorRequest]
|
The connector to check. |
required |
component
|
Union[ComponentResponse, ComponentBase]
|
The stack component that the connector is associated with. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the requirements are satisfied, False otherwise, and a |
str
|
message describing the reason for the failure. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 | |
ServiceConnectorResourcesInfo
Bases: BaseModel
Information about the service connector resources needed for CLI and UI.
ServiceConnectorResourcesModel
Bases: BaseModel
Service connector resources list.
Lists the resource types and resource instances that a service connector can provide access to.
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
| Type | Description |
|---|---|
str
|
The emojified connector type. |
resource_types: List[str]
property
Get the resource types.
Returns:
| Type | Description |
|---|---|
List[str]
|
The resource types. |
resources_dict: Dict[str, ServiceConnectorTypedResourcesModel]
property
Get the resources as a dictionary indexed by resource type.
Returns:
| Type | Description |
|---|---|
Dict[str, ServiceConnectorTypedResourcesModel]
|
The resources as a dictionary indexed by resource type. |
type: str
property
Get the connector type.
Returns:
| Type | Description |
|---|---|
str
|
The connector type. |
from_connector_model(connector_model: ServiceConnectorResponse, resource_type: Optional[str] = None) -> ServiceConnectorResourcesModel
classmethod
Initialize a resource model from a connector model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connector_model
|
ServiceConnectorResponse
|
The connector model. |
required |
resource_type
|
Optional[str]
|
The resource type to set on the resource model. If omitted, the resource type is set according to the connector model. |
None
|
Returns:
| Type | Description |
|---|---|
ServiceConnectorResourcesModel
|
A resource list model instance. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 | |
get_default_resource_id() -> Optional[str]
Get the default resource ID, if included in the resource list.
The default resource ID is a resource ID supplied by the connector implementation only for resource types that do not support multiple instances.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The default resource ID, or None if no resource ID is set. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 | |
get_emojified_resource_types(resource_type: Optional[str] = None) -> List[str]
Get the emojified resource type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_type
|
Optional[str]
|
The resource type to get the emojified resource type for. If omitted, the emojified resource type for all resource types is returned. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
The list of emojified resource types. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | |
set_error(error: str, resource_type: Optional[str] = None) -> None
Set a global error message or an error for a single resource type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
error
|
str
|
The error message. |
required |
resource_type
|
Optional[str]
|
The resource type to set the error message for. If omitted, or if there is only one resource type involved, the error message is (also) set globally. |
None
|
Raises:
| Type | Description |
|---|---|
KeyError
|
If the resource type is not found in the resources list. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | |
set_resource_ids(resource_type: str, resource_ids: List[str]) -> None
Set the resource IDs for a resource type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_type
|
str
|
The resource type to set the resource IDs for. |
required |
resource_ids
|
List[str]
|
The resource IDs to set. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the resource type is not found in the resources list. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | |
ServiceConnectorResponse
Bases: UserScopedResponse[ServiceConnectorResponseBody, ServiceConnectorResponseMetadata, ServiceConnectorResponseResources]
Response model for service connectors.
auth_method: str
property
The auth_method property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
configuration: ServiceConnectorConfiguration
property
The configuration property.
Returns:
| Type | Description |
|---|---|
ServiceConnectorConfiguration
|
the value of the property. |
connector_type: Union[str, ServiceConnectorTypeModel]
property
The connector_type property.
Returns:
| Type | Description |
|---|---|
Union[str, ServiceConnectorTypeModel]
|
the value of the property. |
description: str
property
The description property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
| Type | Description |
|---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector type.
Returns:
| Type | Description |
|---|---|
List[str]
|
The emojified connector type. |
expiration_seconds: Optional[int]
property
The expiration_seconds property.
Returns:
| Type | Description |
|---|---|
Optional[int]
|
the value of the property. |
expires_at: Optional[datetime]
property
The expires_at property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
expires_skew_tolerance: Optional[int]
property
The expires_skew_tolerance property.
Returns:
| Type | Description |
|---|---|
Optional[int]
|
the value of the property. |
is_multi_instance: bool
property
Checks if the connector is multi-instance.
A multi-instance connector is configured to access multiple instances of the configured resource type.
Returns:
| Type | Description |
|---|---|
bool
|
True if the connector is multi-instance, False otherwise. |
is_multi_type: bool
property
Checks if the connector is multi-type.
A multi-type connector can be used to access multiple types of resources.
Returns:
| Type | Description |
|---|---|
bool
|
True if the connector is multi-type, False otherwise. |
is_single_instance: bool
property
Checks if the connector is single-instance.
A single-instance connector is configured to access only a single instance of the configured resource type or does not support multiple resource instances.
Returns:
| Type | Description |
|---|---|
bool
|
True if the connector is single-instance, False otherwise. |
labels: Dict[str, str]
property
The labels property.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
the value of the property. |
resource_id: Optional[str]
property
The resource_id property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
resource_types: List[str]
property
The resource_types property.
Returns:
| Type | Description |
|---|---|
List[str]
|
the value of the property. |
supports_instances: bool
property
The supports_instances property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
type: str
property
Get the connector type.
Returns:
| Type | Description |
|---|---|
str
|
The connector type. |
add_secrets(secrets: Dict[str, str]) -> None
Add the secrets to the configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
secrets
|
Dict[str, str]
|
The secrets to add to the configuration. |
required |
Source code in src/zenml/models/v2/core/service_connector.py
839 840 841 842 843 844 845 | |
get_analytics_metadata() -> Dict[str, Any]
Add the service connector labels to analytics metadata.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
get_hydrated_version() -> ServiceConnectorResponse
Get the hydrated version of this service connector.
Returns:
| Type | Description |
|---|---|
ServiceConnectorResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service_connector.py
611 612 613 614 615 616 617 618 619 | |
remove_secrets() -> None
Remove the secrets from the configuration.
Source code in src/zenml/models/v2/core/service_connector.py
832 833 834 835 836 837 | |
set_connector_type(value: Union[str, ServiceConnectorTypeModel]) -> None
Auxiliary method to set the connector type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Union[str, ServiceConnectorTypeModel]
|
the new value for the connector type. |
required |
Source code in src/zenml/models/v2/core/service_connector.py
703 704 705 706 707 708 709 710 711 | |
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 | |
validate_configuration() -> None
Validate the configuration of the connector.
Source code in src/zenml/models/v2/core/service_connector.py
713 714 715 716 717 718 719 720 721 | |
ServiceConnectorResponseBody
ServiceConnectorResponseMetadata
ServiceConnectorResponseResources
Bases: UserScopedResponseResources
Class for all resource models associated with the service connector entity.
ServiceConnectorTypeModel
Bases: BaseModel
Service connector type specification.
Describes the types of resources to which the service connector can be used to gain access and the authentication methods that are supported by the service connector.
The connector type, resource types, resource IDs and authentication methods can all be used as search criteria to lookup and filter service connector instances that are compatible with the requirements of a consumer (e.g. a stack component).
auth_method_dict: Dict[str, AuthenticationMethodModel]
property
Returns a map of authentication methods to authentication method specifications.
Returns:
| Type | Description |
|---|---|
Dict[str, AuthenticationMethodModel]
|
A map of authentication methods to authentication method |
Dict[str, AuthenticationMethodModel]
|
specifications. |
connector_class: Optional[Type[ServiceConnector]]
property
Get the service connector class.
Returns:
| Type | Description |
|---|---|
Optional[Type[ServiceConnector]]
|
The service connector class. |
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
| Type | Description |
|---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector types.
Returns:
| Type | Description |
|---|---|
List[str]
|
The emojified connector types. |
resource_type_dict: Dict[str, ResourceTypeModel]
property
Returns a map of resource types to resource type specifications.
Returns:
| Type | Description |
|---|---|
Dict[str, ResourceTypeModel]
|
A map of resource types to resource type specifications. |
find_resource_specifications(auth_method: str, resource_type: Optional[str] = None) -> Tuple[AuthenticationMethodModel, Optional[ResourceTypeModel]]
Find the specifications for a configurable resource.
Validate the supplied connector configuration parameters against the connector specification and return the matching authentication method specification and resource specification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth_method
|
str
|
The name of the authentication method. |
required |
resource_type
|
Optional[str]
|
The type of resource being configured. |
None
|
Returns:
| Type | Description |
|---|---|
AuthenticationMethodModel
|
The authentication method specification and resource specification |
Optional[ResourceTypeModel]
|
for the specified authentication method and resource type. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the authentication method is not supported by the connector for the specified resource type and ID. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | |
set_connector_class(connector_class: Type[ServiceConnector]) -> None
Set the service connector class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connector_class
|
Type[ServiceConnector]
|
The service connector class. |
required |
Source code in src/zenml/models/v2/misc/service_connector_type.py
321 322 323 324 325 326 327 328 329 | |
validate_auth_methods(values: List[AuthenticationMethodModel]) -> List[AuthenticationMethodModel]
classmethod
Validate that the authentication methods are unique.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
List[AuthenticationMethodModel]
|
The list of authentication methods. |
required |
Returns:
| Type | Description |
|---|---|
List[AuthenticationMethodModel]
|
The list of authentication methods. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If two or more authentication method specifications share the same authentication method value. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
validate_resource_types(values: List[ResourceTypeModel]) -> List[ResourceTypeModel]
classmethod
Validate that the resource types are unique.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
List[ResourceTypeModel]
|
The list of resource types. |
required |
Returns:
| Type | Description |
|---|---|
List[ResourceTypeModel]
|
The list of resource types. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If two or more resource type specifications list the same resource type. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
ServiceConnectorTypedResourcesModel
Bases: BaseModel
Service connector typed resources list.
Lists the resource instances that a service connector can provide access to.
ServiceConnectorUpdate
Bases: BaseUpdate
Model used for service connector updates.
Most fields in the update model are optional and will not be updated if omitted. However, the following fields are "special" and leaving them out will also cause the corresponding value to be removed from the service connector in the database:
- the
resource_idfield - the
expiration_secondsfield
In addition to the above exceptions, the following rules apply:
- the
configurationfield represents a full valid configuration update, not just a partial update. If it is set (i.e. not None) in the update, its values will replace the existing configuration values. - the
labelsfield is also a full labels update: if set (i.e. notNone), all existing labels are removed and replaced by the new labels in the update.
NOTE: the attributes here override the ones in the base class, so they have a None default value.
type: Optional[str]
property
Get the connector type.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The connector type. |
convert_to_request() -> ServiceConnectorRequest
Method to generate a service connector request object from self.
For certain operations, the service connector update model need to adhere to the limitations set by the request model. In order to use update models in such situations, we need to be able to convert an update model into a request model.
Returns:
| Type | Description |
|---|---|
ServiceConnectorRequest
|
The equivalent request model |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if the model can not be converted to a request model. |
Source code in src/zenml/models/v2/core/service_connector.py
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
get_analytics_metadata() -> Dict[str, Any]
Format the resource types in the analytics metadata.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 | |
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 | |
ServiceFilter
Bases: ProjectScopedFilter
Model to enable advanced filtering of services.
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Services can be scoped by type to narrow the search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
| Type | Description |
|---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Source code in src/zenml/models/v2/core/service.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 | |
set_flavor(flavor: str) -> None
Set the flavor of the service.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flavor
|
str
|
The flavor of the service. |
required |
Source code in src/zenml/models/v2/core/service.py
468 469 470 471 472 473 474 | |
set_type(type: str) -> None
Set the type of the service.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
str
|
The type of the service. |
required |
Source code in src/zenml/models/v2/core/service.py
460 461 462 463 464 465 466 | |
ServiceRequest
ServiceResponse
Bases: ProjectScopedResponse[ServiceResponseBody, ServiceResponseMetadata, ServiceResponseResources]
Response model for services.
admin_state: Optional[ServiceState]
property
The admin_state property.
Returns:
| Type | Description |
|---|---|
Optional[ServiceState]
|
the value of the property. |
config: Dict[str, Any]
property
The config property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
created: datetime
property
The created property.
Returns:
| Type | Description |
|---|---|
datetime
|
the value of the property. |
endpoint: Optional[Dict[str, Any]]
property
The endpoint property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
health_check_url: Optional[str]
property
The health_check_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
labels: Optional[Dict[str, str]]
property
The labels property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, str]]
|
the value of the property. |
model_version: Optional[ModelVersionResponse]
property
The model_version property.
Returns:
| Type | Description |
|---|---|
Optional[ModelVersionResponse]
|
the value of the property. |
pipeline_run: Optional[PipelineRunResponse]
property
The pipeline_run property.
Returns:
| Type | Description |
|---|---|
Optional[PipelineRunResponse]
|
the value of the property. |
prediction_url: Optional[str]
property
The prediction_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
service_source: Optional[str]
property
The service_source property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
service_type: ServiceType
property
state: Optional[ServiceState]
property
status: Optional[Dict[str, Any]]
property
The status property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
updated: datetime
property
The updated property.
Returns:
| Type | Description |
|---|---|
datetime
|
the value of the property. |
get_hydrated_version() -> ServiceResponse
Get the hydrated version of this artifact.
Returns:
| Type | Description |
|---|---|
ServiceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service.py
266 267 268 269 270 271 272 273 274 | |
ServiceResponseBody
ServiceResponseMetadata
ServiceResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the service entity.
ServiceType
Bases: BaseModel
Service type descriptor.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
service type |
flavor |
str
|
service flavor |
name |
str
|
name of the service type |
description |
str
|
description of the service type |
logo_url |
str
|
logo of the service type |
ServiceUpdate
StackDeploymentConfig
Bases: BaseModel
Configuration about a stack deployment.
StackDeploymentInfo
Bases: BaseModel
Information about a stack deployment.
StackFilter
Bases: UserScopedFilter
Model to enable advanced stack filtering.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/stack.py
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | |
StackRequest
StackResponse
Bases: UserScopedResponse[StackResponseBody, StackResponseMetadata, StackResponseResources]
Response model for stacks.
components: Dict[StackComponentType, List[ComponentResponse]]
property
The components property.
Returns:
| Type | Description |
|---|---|
Dict[StackComponentType, List[ComponentResponse]]
|
the value of the property. |
description: Optional[str]
property
The description property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
environment: Dict[str, str]
property
The environment property.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
the value of the property. |
is_valid: bool
property
Check if the stack is valid.
Returns:
| Type | Description |
|---|---|
bool
|
True if the stack is valid, False otherwise. |
labels: Optional[Dict[str, Any]]
property
The labels property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
secrets: List[UUID]
property
The secrets property.
Returns:
| Type | Description |
|---|---|
List[UUID]
|
the value of the property. |
stack_spec_path: Optional[str]
property
The stack_spec_path property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
get_analytics_metadata() -> Dict[str, Any]
Add the stack components to the stack analytics metadata.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/stack.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
get_hydrated_version() -> StackResponse
Get the hydrated version of this stack.
Returns:
| Type | Description |
|---|---|
StackResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/stack.py
288 289 290 291 292 293 294 295 296 | |
to_yaml() -> Dict[str, Any]
Create yaml representation of the Stack Model.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The yaml representation of the Stack Model. |
Source code in src/zenml/models/v2/core/stack.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
StackResponseBody
StackResponseMetadata
StackResponseResources
StackUpdate
StepHeartbeatResponse
Bases: BaseModel
Light-weight model for Step Heartbeat responses.
StepRunFilter
Bases: ProjectScopedFilter, RunMetadataFilterMixin
Model to enable advanced filtering of step runs.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/step_run.py
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | |
StepRunIdentifier
Bases: BaseModel
Class grouping different step run identifiers.
StepRunRequest
StepRunResponse
Bases: ProjectScopedResponse[StepRunResponseBody, StepRunResponseMetadata, StepRunResponseResources]
Response model for step runs.
cache_expires_at: Optional[datetime]
property
The cache_expires_at property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
cache_key: Optional[str]
property
The cache_key property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
code_hash: Optional[str]
property
The code_hash property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
config: StepConfiguration
property
docstring: Optional[str]
property
The docstring property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
heartbeat_threshold: Optional[int]
property
The heartbeat_threshold property.
Returns:
| Type | Description |
|---|---|
Optional[int]
|
the value of the property. |
input: StepRunInputResponse
property
Returns the input artifact that was used to run this step.
Returns:
| Type | Description |
|---|---|
StepRunInputResponse
|
The input artifact. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If there were zero or multiple inputs to this step. |
inputs: Dict[str, List[StepRunInputResponse]]
property
The inputs property.
Returns:
| Type | Description |
|---|---|
Dict[str, List[StepRunInputResponse]]
|
the value of the property. |
is_retriable: bool
property
The is_retriable property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
latest_heartbeat: Optional[datetime]
property
The latest_heartbeat property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
log_collection: Optional[List[LogsResponse]]
property
The log_collection property.
Returns:
| Type | Description |
|---|---|
Optional[List[LogsResponse]]
|
the value of the property. |
model_version: Optional[ModelVersionResponse]
property
The model_version property.
Returns:
| Type | Description |
|---|---|
Optional[ModelVersionResponse]
|
the value of the property. |
model_version_id: Optional[UUID]
property
The model_version_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
original_step_run_id: Optional[UUID]
property
The original_step_run_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
output: ArtifactVersionResponse
property
Returns the output artifact that was written by this step.
Returns:
| Type | Description |
|---|---|
ArtifactVersionResponse
|
The output artifact. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If there were zero or multiple step outputs. |
outputs: Dict[str, List[ArtifactVersionResponse]]
property
The outputs property.
Returns:
| Type | Description |
|---|---|
Dict[str, List[ArtifactVersionResponse]]
|
the value of the property. |
parent_step_ids: List[UUID]
property
The parent_step_ids property.
Returns:
| Type | Description |
|---|---|
List[UUID]
|
the value of the property. |
pipeline_run_id: UUID
property
The pipeline_run_id property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
regular_inputs: Dict[str, List[StepRunInputResponse]]
property
Returns the regular step inputs of the step run.
Regular step inputs are the inputs that are defined in the step function signature, and are not manually loaded during the step execution.
Returns:
| Type | Description |
|---|---|
Dict[str, List[StepRunInputResponse]]
|
The regular step inputs. |
regular_outputs: Dict[str, ArtifactVersionResponse]
property
Returns the regular step outputs of the step run.
Regular step outputs are the outputs that are defined in the step function signature, and are not manually saved during the step execution.
Raises:
| Type | Description |
|---|---|
ValueError
|
If there were multiple regular output artifacts for the same output name. |
Returns:
| Type | Description |
|---|---|
Dict[str, ArtifactVersionResponse]
|
The regular step outputs. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata property.
Returns:
| Type | Description |
|---|---|
Dict[str, MetadataType]
|
the value of the property. |
snapshot_id: UUID
property
The snapshot_id property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
source_code: Optional[str]
property
The source_code property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
spec: StepSpec
property
start_time: Optional[datetime]
property
The start_time property.
Returns:
| Type | Description |
|---|---|
Optional[datetime]
|
the value of the property. |
status: ExecutionStatus
property
substitutions: Dict[str, str]
property
The substitutions property.
Returns:
| Type | Description |
|---|---|
Dict[str, str]
|
the value of the property. |
version: int
property
The version property.
Returns:
| Type | Description |
|---|---|
int
|
the value of the property. |
get_hydrated_version() -> StepRunResponse
Get the hydrated version of this step run.
Returns:
| Type | Description |
|---|---|
StepRunResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/step_run.py
356 357 358 359 360 361 362 363 364 | |
StepRunResponseBody
StepRunResponseMetadata
StepRunResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the step run entity.
StepRunUpdate
StrFilter
Bases: Filter
Filter for all string fields.
check_value_if_operation_oneof() -> StrFilter
Validator to check if value is a list if oneof operation is used.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the value is not a list |
Returns:
| Type | Description |
|---|---|
StrFilter
|
self |
Source code in src/zenml/models/v2/base/filter.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a string column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column
|
Any
|
The string column of an SQLModel table on which to filter. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
Tag
Bases: BaseModel
A model representing a tag.
to_request() -> TagRequest
Convert the tag to a TagRequest.
Returns:
| Type | Description |
|---|---|
TagRequest
|
The tag as a TagRequest. |
Source code in src/zenml/utils/tag_utils.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
TagFilter
Bases: UserScopedFilter
Model to enable advanced filtering of all tags.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/tag.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
TagRequest
Bases: UserScopedRequest
Request model for tags.
validate_name_not_uuid(value: str) -> str
classmethod
Validates that the tag name is not a UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
The tag name to validate. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The validated tag name. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the tag name can be converted to a UUID. |
Source code in src/zenml/models/v2/core/tag.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
TagResource
Bases: BaseModel
Utility class to help identify resources to tag.
TagResourceRequest
TagResourceResponse
Bases: BaseIdentifiedResponse[TagResourceResponseBody, BaseResponseMetadata, TagResourceResponseResources]
Response model for the links between tags and resources.
resource_id: UUID
property
The resource_id property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
resource_type: TaggableResourceTypes
property
The resource_type property.
Returns:
| Type | Description |
|---|---|
TaggableResourceTypes
|
the value of the property. |
tag_id: UUID
property
The tag_id property.
Returns:
| Type | Description |
|---|---|
UUID
|
the value of the property. |
TagResourceResponseBody
TagResponse
Bases: UserScopedResponse[TagResponseBody, TagResponseMetadata, TagResponseResources]
Response model for tags.
color: ColorVariants
property
exclusive: bool
property
The exclusive property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
tagged_count: int
property
The tagged_count property.
Returns:
| Type | Description |
|---|---|
int
|
the value of the property. |
get_hydrated_version() -> TagResponse
Get the hydrated version of this tag.
Returns:
| Type | Description |
|---|---|
TagResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/tag.py
154 155 156 157 158 159 160 161 162 | |
TagResponseBody
TagResponseMetadata
TagResponseResources
TagUpdate
Bases: BaseUpdate
Update model for tags.
validate_name_not_uuid(value: Optional[str]) -> Optional[str]
classmethod
Validates that the tag name is not a UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Optional[str]
|
The tag name to validate. |
required |
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The validated tag name. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the tag name can be converted to a UUID. |
Source code in src/zenml/models/v2/core/tag.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
TaggableFilter
Bases: BaseFilter
Model to enable filtering and sorting by tags.
add_tag_to_tags() -> TaggableFilter
Deprecated the tag attribute in favor of the tags attribute.
Returns:
| Type | Description |
|---|---|
TaggableFilter
|
self |
Source code in src/zenml/models/v2/base/scoped.py
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | |
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom tag filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | |
TriggerExecutionFilter
TriggerExecutionRequest
TriggerExecutionResponse
Bases: BaseIdentifiedResponse[TriggerExecutionResponseBody, TriggerExecutionResponseMetadata, TriggerExecutionResponseResources]
Response model for trigger executions.
event_metadata: Dict[str, Any]
property
The event_metadata property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
trigger: TriggerResponse
property
get_hydrated_version() -> TriggerExecutionResponse
Get the hydrated version of this trigger execution.
Returns:
| Type | Description |
|---|---|
TriggerExecutionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/trigger_execution.py
78 79 80 81 82 83 84 85 86 | |
TriggerExecutionResponseBody
TriggerExecutionResponseMetadata
TriggerExecutionResponseResources
TriggerFilter
Bases: ProjectScopedFilter
Model to enable advanced filtering of all triggers.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/trigger.py
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
TriggerRequest
TriggerResponse
Bases: ProjectScopedResponse[TriggerResponseBody, TriggerResponseMetadata, TriggerResponseResources]
Response model for models.
action: ActionResponse
property
action_flavor: str
property
The action_flavor property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
action_subtype: str
property
The action_subtype property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
description: str
property
The description property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
event_filter: Optional[Dict[str, Any]]
property
The event_filter property.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
event_source: Optional[EventSourceResponse]
property
The event_source property.
Returns:
| Type | Description |
|---|---|
Optional[EventSourceResponse]
|
the value of the property. |
event_source_flavor: Optional[str]
property
The event_source_flavor property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
event_source_subtype: Optional[str]
property
The event_source_subtype property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
executions: Page[TriggerExecutionResponse]
property
The event_source property.
Returns:
| Type | Description |
|---|---|
Page[TriggerExecutionResponse]
|
the value of the property. |
is_active: bool
property
The is_active property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
get_hydrated_version() -> TriggerResponse
Get the hydrated version of this trigger.
Returns:
| Type | Description |
|---|---|
TriggerResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/trigger.py
223 224 225 226 227 228 229 230 231 | |
TriggerResponseBody
TriggerResponseMetadata
TriggerResponseResources
Bases: ProjectScopedResponseResources
Class for all resource models associated with the trigger entity.
TriggerUpdate
UUIDFilter
Bases: StrFilter
Filter for all uuid fields which are mostly treated like strings.
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a UUID column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column
|
Any
|
The UUID column of an SQLModel table on which to filter. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |
UserAuthModel
Bases: BaseZenModel
Authentication Model for the User.
This model is only used server-side. The server endpoints can use this model to authenticate the user credentials (Token, Password).
get_hashed_activation_token() -> Optional[str]
Returns the hashed activation token, if configured.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The hashed activation token. |
Source code in src/zenml/models/v2/misc/user_auth.py
139 140 141 142 143 144 145 | |
get_hashed_password() -> Optional[str]
Returns the hashed password, if configured.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The hashed password. |
Source code in src/zenml/models/v2/misc/user_auth.py
131 132 133 134 135 136 137 | |
get_password() -> Optional[str]
Get the password.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The password as a plain string, if it exists. |
Source code in src/zenml/models/v2/misc/user_auth.py
121 122 123 124 125 126 127 128 129 | |
verify_activation_token(activation_token: str, user: Optional[UserAuthModel] = None) -> bool
classmethod
Verifies a given activation token against the stored token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
activation_token
|
str
|
Input activation token to be verified. |
required |
user
|
Optional[UserAuthModel]
|
User for which the activation token is to be verified. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the token is valid. |
Source code in src/zenml/models/v2/misc/user_auth.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
verify_password(plain_password: str, user: Optional[UserAuthModel] = None) -> bool
classmethod
Verifies a given plain password against the stored password.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plain_password
|
str
|
Input password to be verified. |
required |
user
|
Optional[UserAuthModel]
|
User for which the password is to be verified. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the passwords match. |
Source code in src/zenml/models/v2/misc/user_auth.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
UserFilter
Bases: BaseFilter
Model to enable advanced filtering of all Users.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to filter out service accounts from the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/user.py
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
UserRequest
UserResponse
Bases: BaseIdentifiedResponse[UserResponseBody, UserResponseMetadata, UserResponseResources]
Response model for user and service accounts.
This returns the activation_token that is required for the user-invitation-flow of the frontend. The email is returned optionally as well for use by the analytics on the client-side.
activation_token: Optional[str]
property
The activation_token property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
active: bool
property
The active property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
avatar_url: Optional[str]
property
The avatar_url property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
default_project_id: Optional[UUID]
property
The default_project_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
email: Optional[str]
property
The email property.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
the value of the property. |
email_opted_in: Optional[bool]
property
The email_opted_in property.
Returns:
| Type | Description |
|---|---|
Optional[bool]
|
the value of the property. |
external_user_id: Optional[UUID]
property
The external_user_id property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
full_name: str
property
The full_name property.
Returns:
| Type | Description |
|---|---|
str
|
the value of the property. |
is_admin: bool
property
The is_admin property.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the user is an admin. |
is_service_account: bool
property
The is_service_account property.
Returns:
| Type | Description |
|---|---|
bool
|
the value of the property. |
user_metadata: Dict[str, Any]
property
The user_metadata property.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
the value of the property. |
get_hydrated_version() -> UserResponse
Get the hydrated version of this user.
Returns:
| Type | Description |
|---|---|
UserResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/user.py
346 347 348 349 350 351 352 353 354 | |
UserResponseBody
UserResponseMetadata
UserScopedFilter
Bases: BaseFilter
Model to enable advanced user-based scoping.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
| Type | Description |
|---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
set_scope_user(user_id: UUID) -> None
Set the user that is performing the filtering to scope the response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
UUID
|
The user ID to scope the response to. |
required |
Source code in src/zenml/models/v2/base/scoped.py
197 198 199 200 201 202 203 | |
UserScopedRequest
Bases: BaseRequest
Base user-owned request model.
Used as a base class for all domain models that are "owned" by a user.
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for user scoped models.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
72 73 74 75 76 77 78 79 80 | |
UserScopedResponse
Bases: BaseIdentifiedResponse[UserBody, UserMetadata, UserResources], Generic[UserBody, UserMetadata, UserResources]
Base user-owned model.
Used as a base class for all domain models that are "owned" by a user.
user: Optional[UserResponse]
property
user_id: Optional[UUID]
property
The user ID property.
Returns:
| Type | Description |
|---|---|
Optional[UUID]
|
the value of the property. |
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for user scoped models.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
139 140 141 142 143 144 145 146 147 148 | |
UserScopedResponseBody
UserScopedResponseMetadata
UserUpdate
Bases: UserBase, BaseUpdate
Update model for users.
create_copy(exclude: AbstractSet[str]) -> UserUpdate
Create a copy of the current instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exclude
|
AbstractSet[str]
|
Fields to exclude from the copy. |
required |
Returns:
| Type | Description |
|---|---|
UserUpdate
|
A copy of the current instance. |
Source code in src/zenml/models/v2/core/user.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | |
user_email_updates() -> UserUpdate
Validate that the UserUpdateModel conforms to the email-opt-in-flow.
Returns:
| Type | Description |
|---|---|
UserUpdate
|
The validated values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the email was not provided when the email_opted_in field was set to True. |
Source code in src/zenml/models/v2/core/user.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | |
Functions
add_tags(tags: Union[str, Tag, List[Union[str, Tag]]], pipeline: Optional[Union[UUID, str]] = None, run: Optional[Union[UUID, str]] = None, run_template: Optional[Union[UUID, str]] = None, snapshot: Optional[Union[UUID, str]] = None, deployment: Optional[Union[UUID, str]] = None, artifact: Optional[Union[UUID, str]] = None, artifact_version_id: Optional[UUID] = None, artifact_name: Optional[str] = None, artifact_version: Optional[str] = None, infer_artifact: Optional[bool] = None) -> None
add_tags(
tags: Union[str, Tag, List[Union[str, Tag]]],
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
run: Union[UUID, str],
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
artifact: Union[UUID, str],
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
artifact_version_id: UUID,
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
artifact_name: str,
artifact_version: str,
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
infer_artifact: bool = False,
artifact_name: Optional[str] = None,
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
pipeline: Union[UUID, str],
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
run_template: Union[UUID, str],
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
snapshot: Union[UUID, str],
) -> None
add_tags(
*,
tags: Union[str, Tag, List[Union[str, Tag]]],
deployment: Union[UUID, str],
) -> None
Add tags to various resource types in a generalized way.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tags
|
Union[str, Tag, List[Union[str, Tag]]]
|
The tags to add. |
required |
pipeline
|
Optional[Union[UUID, str]]
|
The ID or the name of the pipeline. |
None
|
run
|
Optional[Union[UUID, str]]
|
The id, name or prefix of the run. |
None
|
run_template
|
Optional[Union[UUID, str]]
|
The ID or the name of the run template. |
None
|
snapshot
|
Optional[Union[UUID, str]]
|
The ID of the snapshot. |
None
|
deployment
|
Optional[Union[UUID, str]]
|
The ID or the name of the deployment. |
None
|
artifact
|
Optional[Union[UUID, str]]
|
The ID or the name of the artifact. |
None
|
artifact_version_id
|
Optional[UUID]
|
The ID of the artifact version. |
None
|
artifact_name
|
Optional[str]
|
The name of the artifact. |
None
|
artifact_version
|
Optional[str]
|
The version of the artifact. |
None
|
infer_artifact
|
Optional[bool]
|
Flag deciding whether the artifact version should be inferred from the step context. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If no identifiers are provided and the function is not called from within a step, or if exclusive is provided for a resource type that doesn't support it. |
Source code in src/zenml/utils/tag_utils.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |
bulk_log_metadata(metadata: Dict[str, MetadataType], pipeline_runs: list[PipelineRunIdentifier] | None = None, step_runs: list[StepRunIdentifier] | None = None, artifact_versions: list[ArtifactVersionIdentifier] | None = None, model_versions: list[ModelVersionIdentifier] | None = None, infer_models: bool = False, infer_artifacts: bool = False) -> None
Logs metadata for multiple entities in a single invocation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, MetadataType]
|
The metadata to log. |
required |
pipeline_runs
|
list[PipelineRunIdentifier] | None
|
A list of pipeline runs to log metadata for. |
None
|
step_runs
|
list[StepRunIdentifier] | None
|
A list of step runs to log metadata for. |
None
|
artifact_versions
|
list[ArtifactVersionIdentifier] | None
|
A list of artifact versions to log metadata for. |
None
|
model_versions
|
list[ModelVersionIdentifier] | None
|
A list of model versions to log metadata for. |
None
|
infer_models
|
bool
|
Flag - when enabled infer model to log metadata for from step context. |
False
|
infer_artifacts
|
bool
|
Flag - when enabled infer artifact to log metadata for from step context. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If options are not passed correctly (empty metadata or no identifier options) or
invocation with |
Source code in src/zenml/utils/metadata_utils.py
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
get_pipeline_context() -> PipelineContext
Get the context of the current pipeline.
Returns:
| Type | Description |
|---|---|
PipelineContext
|
The context of the current pipeline. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no active pipeline is found. |
RuntimeError
|
If inside a running step. |
Source code in src/zenml/pipelines/pipeline_context.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
get_step_context() -> StepContext
Get the context of the currently running step.
Returns:
| Type | Description |
|---|---|
StepContext
|
The context of the currently running step. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no step is currently running. |
Source code in src/zenml/steps/step_context.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
link_artifact_to_model(artifact_version: ArtifactVersionResponse, model: Optional[Model] = None) -> None
Link the artifact to the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
artifact_version
|
ArtifactVersionResponse
|
The artifact version to link. |
required |
model
|
Optional[Model]
|
The model to link to. |
None
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If called outside a step. |
Source code in src/zenml/model/utils.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
load_artifact(name_or_id: Union[str, UUID], version: Optional[str] = None) -> Any
Load an artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_id
|
Union[str, UUID]
|
The name or ID of the artifact to load. |
required |
version
|
Optional[str]
|
The version of the artifact to load, if |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The loaded artifact. |
Source code in src/zenml/artifacts/utils.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
log_artifact_metadata(metadata: Dict[str, MetadataType], artifact_name: Optional[str] = None, artifact_version: Optional[str] = None) -> None
Log artifact metadata.
This function can be used to log metadata for either existing artifact versions or artifact versions that are newly created in the same step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, MetadataType]
|
The metadata to log. |
required |
artifact_name
|
Optional[str]
|
The name of the artifact to log metadata for. Can be omitted when being called inside a step with only one output. |
None
|
artifact_version
|
Optional[str]
|
The version of the artifact to log metadata for. If
not provided, when being called inside a step that produces an
artifact named |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If no artifact name is provided and the function is not called inside a step with a single output, or, if neither an artifact nor an output with the given name exists. |
Source code in src/zenml/artifacts/utils.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | |
log_metadata(metadata: Dict[str, MetadataType], step_id: Optional[UUID] = None, step_name: Optional[str] = None, run_id_name_or_prefix: Optional[Union[UUID, str]] = None, artifact_version_id: Optional[UUID] = None, artifact_name: Optional[str] = None, artifact_version: Optional[str] = None, infer_artifact: bool = False, model_version_id: Optional[UUID] = None, model_name: Optional[str] = None, model_version: Optional[Union[ModelStages, int, str]] = None, infer_model: bool = False) -> None
log_metadata(metadata: Dict[str, MetadataType]) -> None
log_metadata(
*, metadata: Dict[str, MetadataType], step_id: UUID
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
step_name: str,
run_id_name_or_prefix: Union[UUID, str],
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
run_id_name_or_prefix: Union[UUID, str],
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
artifact_version_id: UUID,
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
artifact_name: str,
artifact_version: Optional[str] = None,
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
infer_artifact: bool = False,
artifact_name: Optional[str] = None,
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
model_version_id: UUID,
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
model_name: str,
model_version: Union[ModelStages, int, str],
) -> None
log_metadata(
*,
metadata: Dict[str, MetadataType],
infer_model: bool = False,
) -> None
Logs metadata for various resource types in a generalized way.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, MetadataType]
|
The metadata to log. |
required |
step_id
|
Optional[UUID]
|
The ID of the step. |
None
|
step_name
|
Optional[str]
|
The name of the step. |
None
|
run_id_name_or_prefix
|
Optional[Union[UUID, str]]
|
The id, name or prefix of the run |
None
|
artifact_version_id
|
Optional[UUID]
|
The ID of the artifact version |
None
|
artifact_name
|
Optional[str]
|
The name of the artifact. |
None
|
artifact_version
|
Optional[str]
|
The version of the artifact. |
None
|
infer_artifact
|
bool
|
Flag deciding whether the artifact version should be inferred from the step context. |
False
|
model_version_id
|
Optional[UUID]
|
The ID of the model version. |
None
|
model_name
|
Optional[str]
|
The name of the model. |
None
|
model_version
|
Optional[Union[ModelStages, int, str]]
|
The version of the model. |
None
|
infer_model
|
bool
|
Flag deciding whether the model version should be inferred from the step context. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If no identifiers are provided and the function is not called from within a step. |
Source code in src/zenml/utils/metadata_utils.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
log_model_metadata(metadata: Dict[str, MetadataType], model_name: Optional[str] = None, model_version: Optional[Union[ModelStages, int, str]] = None) -> None
Log model version metadata.
This function can be used to log metadata for existing model versions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, MetadataType]
|
The metadata to log. |
required |
model_name
|
Optional[str]
|
The name of the model to log metadata for. Can
be omitted when being called inside a step with configured
|
None
|
model_version
|
Optional[Union[ModelStages, int, str]]
|
The version of the model to log metadata for. Can
be omitted when being called inside a step with configured
|
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the function is not called with proper input. |
Source code in src/zenml/model/utils.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
log_step_metadata(metadata: Dict[str, MetadataType], step_name: Optional[str] = None, pipeline_name_id_or_prefix: Optional[Union[str, UUID]] = None, run_id: Optional[str] = None) -> None
Logs step metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
Dict[str, MetadataType]
|
The metadata to log. |
required |
step_name
|
Optional[str]
|
The name of the step to log metadata for. Can be omitted when being called inside a step. |
None
|
pipeline_name_id_or_prefix
|
Optional[Union[str, UUID]]
|
The name of the pipeline to log metadata for. Can be omitted when being called inside a step. |
None
|
run_id
|
Optional[str]
|
The ID of the run to log metadata for. Can be omitted when being called inside a step. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If no step name is provided and the function is not called from within a step or if no pipeline name or ID is provided and the function is not called from within a step. |
Source code in src/zenml/steps/utils.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
pipeline(_func: Optional[F] = None, *, name: Optional[str] = None, dynamic: Optional[bool] = None, depends_on: Optional[List[BaseStep]] = None, enable_cache: Optional[bool] = None, enable_artifact_metadata: Optional[bool] = None, enable_step_logs: Optional[bool] = None, enable_heartbeat: Optional[bool] = None, environment: Optional[Dict[str, Any]] = None, secrets: Optional[List[Union[UUID, str]]] = None, enable_pipeline_logs: Optional[bool] = None, settings: Optional[Dict[str, SettingsOrDict]] = None, tags: Optional[List[Union[str, Tag]]] = None, extra: Optional[Dict[str, Any]] = None, on_failure: Optional[HookSpecification] = None, on_success: Optional[HookSpecification] = None, on_init: Optional[InitHookSpecification] = None, on_init_kwargs: Optional[Dict[str, Any]] = None, on_cleanup: Optional[HookSpecification] = None, model: Optional[Model] = None, retry: Optional[StepRetryConfig] = None, substitutions: Optional[Dict[str, str]] = None, execution_mode: Optional[ExecutionMode] = None, cache_policy: Optional[CachePolicyOrString] = None) -> Union[Pipeline, Callable[[F], Pipeline]]
pipeline(_func: F) -> Pipeline
pipeline(
*,
name: Optional[str] = None,
dynamic: Optional[bool] = None,
depends_on: Optional[List[BaseStep]] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
enable_heartbeat: Optional[bool] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
enable_pipeline_logs: Optional[bool] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
tags: Optional[List[Union[str, Tag]]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
on_init: Optional[InitHookSpecification] = None,
on_init_kwargs: Optional[Dict[str, Any]] = None,
on_cleanup: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
execution_mode: Optional[ExecutionMode] = None,
cache_policy: Optional[CachePolicyOrString] = None,
) -> Callable[[F], Pipeline]
Decorator to create a pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_func
|
Optional[F]
|
The decorated function. |
None
|
name
|
Optional[str]
|
The name of the pipeline. If left empty, the name of the decorated function will be used as a fallback. |
None
|
dynamic
|
Optional[bool]
|
Whether this is a dynamic pipeline or not. |
None
|
depends_on
|
Optional[List[BaseStep]]
|
The steps that this pipeline depends on. |
None
|
enable_cache
|
Optional[bool]
|
Whether to use caching or not. |
None
|
enable_artifact_metadata
|
Optional[bool]
|
Whether to enable artifact metadata or not. |
None
|
enable_step_logs
|
Optional[bool]
|
If step logs should be enabled for this pipeline. |
None
|
enable_heartbeat
|
Optional[bool]
|
If heartbeat should be enabled for this pipeline. |
None
|
environment
|
Optional[Dict[str, Any]]
|
Environment variables to set when running this pipeline. |
None
|
secrets
|
Optional[List[Union[UUID, str]]]
|
Secrets to set as environment variables when running this pipeline. |
None
|
enable_pipeline_logs
|
Optional[bool]
|
If pipeline logs should be enabled for this pipeline. |
None
|
settings
|
Optional[Dict[str, SettingsOrDict]]
|
Settings for this pipeline. |
None
|
tags
|
Optional[List[Union[str, Tag]]]
|
Tags to apply to runs of the pipeline. |
None
|
extra
|
Optional[Dict[str, Any]]
|
Extra configurations for this pipeline. |
None
|
on_failure
|
Optional[HookSpecification]
|
Callback function in event of failure of the step. Can be a
function with a single argument of type |
None
|
on_success
|
Optional[HookSpecification]
|
Callback function in event of success of the step. Can be a
function with no arguments, or a source path to such a function
(e.g. |
None
|
on_init
|
Optional[InitHookSpecification]
|
Callback function to run on initialization of the pipeline. Can
be a function with no arguments, or a source path to such a function
(e.g. |
None
|
on_init_kwargs
|
Optional[Dict[str, Any]]
|
Arguments for the init hook. |
None
|
on_cleanup
|
Optional[HookSpecification]
|
Callback function to run on cleanup of the pipeline. Can be a
function with no arguments, or a source path to such a function
(e.g. |
None
|
model
|
Optional[Model]
|
configuration of the model in the Model Control Plane. |
None
|
retry
|
Optional[StepRetryConfig]
|
Retry configuration for the pipeline steps. |
None
|
substitutions
|
Optional[Dict[str, str]]
|
Extra substitutions for pipeline run, model and artifact name placeholders. |
None
|
execution_mode
|
Optional[ExecutionMode]
|
The execution mode to use for the pipeline. |
None
|
cache_policy
|
Optional[CachePolicyOrString]
|
Cache policy for this pipeline. |
None
|
Returns:
| Type | Description |
|---|---|
Union[Pipeline, Callable[[F], Pipeline]]
|
A pipeline instance. |
Source code in src/zenml/pipelines/pipeline_decorator.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
register_artifact(folder_or_file_uri: str, name: str, version: Optional[Union[int, str]] = None, artifact_type: Optional[ArtifactType] = None, tags: Optional[List[str]] = None, has_custom_name: bool = True, artifact_metadata: Dict[str, MetadataType] = {}) -> ArtifactVersionResponse
Register existing data stored in the artifact store as a ZenML Artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder_or_file_uri
|
str
|
The full URI within the artifact store to the folder or to the file. |
required |
name
|
str
|
The name of the artifact. |
required |
version
|
Optional[Union[int, str]]
|
The version of the artifact. If not provided, a new auto-incremented version will be used. |
None
|
artifact_type
|
Optional[ArtifactType]
|
The artifact type. If not given, the type will default
to |
None
|
tags
|
Optional[List[str]]
|
Tags to associate with the artifact. |
None
|
has_custom_name
|
bool
|
If the artifact name is custom and should be listed in the dashboard "Artifacts" tab. |
True
|
artifact_metadata
|
Dict[str, MetadataType]
|
Metadata dictionary to attach to the artifact version. |
{}
|
Returns:
| Type | Description |
|---|---|
ArtifactVersionResponse
|
The saved artifact response. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the folder URI is outside the artifact store bounds. |
Source code in src/zenml/artifacts/utils.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
remove_tags(tags: Union[str, List[str]], pipeline: Optional[Union[UUID, str]] = None, run: Optional[Union[UUID, str]] = None, run_template: Optional[Union[UUID, str]] = None, snapshot: Optional[Union[UUID, str]] = None, deployment: Optional[Union[UUID, str]] = None, artifact: Optional[Union[UUID, str]] = None, artifact_version_id: Optional[UUID] = None, artifact_name: Optional[str] = None, artifact_version: Optional[str] = None, infer_artifact: Optional[bool] = None) -> None
remove_tags(tags: Union[str, List[str]]) -> None
remove_tags(
*,
tags: Union[str, List[str]],
pipeline: Union[UUID, str],
) -> None
remove_tags(
*, tags: Union[str, List[str]], run: Union[UUID, str]
) -> None
remove_tags(
*,
tags: Union[str, List[str]],
run_template: Union[UUID, str],
) -> None
remove_tags(
*,
tags: Union[str, List[str]],
snapshot: Union[UUID, str],
) -> None
remove_tags(
*,
tags: Union[str, List[str]],
deployment: Union[UUID, str],
) -> None
remove_tags(
*,
tags: Union[str, List[str]],
artifact: Union[UUID, str],
) -> None
remove_tags(
*,
tags: Union[str, List[str]],
artifact_version_id: UUID,
) -> None
remove_tags(
*,
tags: Union[str, List[str]],
artifact_name: str,
artifact_version: str,
) -> None
remove_tags(
*,
tags: Union[str, List[str]],
infer_artifact: bool = False,
artifact_name: Optional[str] = None,
) -> None
Remove tags from various resource types in a generalized way.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tags
|
Union[str, List[str]]
|
The tags to remove. |
required |
pipeline
|
Optional[Union[UUID, str]]
|
The ID or the name of the pipeline. |
None
|
run
|
Optional[Union[UUID, str]]
|
The id, name or prefix of the run. |
None
|
run_template
|
Optional[Union[UUID, str]]
|
The ID or the name of the run template. |
None
|
snapshot
|
Optional[Union[UUID, str]]
|
The ID of the snapshot. |
None
|
deployment
|
Optional[Union[UUID, str]]
|
The ID or the name of the deployment. |
None
|
artifact
|
Optional[Union[UUID, str]]
|
The ID or the name of the artifact. |
None
|
artifact_version_id
|
Optional[UUID]
|
The ID of the artifact version. |
None
|
artifact_name
|
Optional[str]
|
The name of the artifact. |
None
|
artifact_version
|
Optional[str]
|
The version of the artifact. |
None
|
infer_artifact
|
Optional[bool]
|
Flag deciding whether the artifact version should be inferred from the step context. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If no identifiers are provided and the function is not called from within a step. |
Source code in src/zenml/utils/tag_utils.py
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | |
save_artifact(data: Any, name: str, version: Optional[Union[int, str]] = None, artifact_type: Optional[ArtifactType] = None, tags: Optional[List[str]] = None, extract_metadata: bool = True, include_visualizations: bool = True, user_metadata: Optional[Dict[str, MetadataType]] = None, materializer: Optional[MaterializerClassOrSource] = None, uri: Optional[str] = None, save_type: ArtifactSaveType = ArtifactSaveType.MANUAL, has_custom_name: bool = True) -> ArtifactVersionResponse
Upload and publish an artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the artifact. |
required |
data
|
Any
|
The artifact data. |
required |
version
|
Optional[Union[int, str]]
|
The version of the artifact. If not provided, a new auto-incremented version will be used. |
None
|
tags
|
Optional[List[str]]
|
Tags to associate with the artifact. |
None
|
artifact_type
|
Optional[ArtifactType]
|
The artifact type. If not given, the type will be defined by the materializer that is used to save the artifact. |
None
|
extract_metadata
|
bool
|
If artifact metadata should be extracted and returned. |
True
|
include_visualizations
|
bool
|
If artifact visualizations should be generated. |
True
|
user_metadata
|
Optional[Dict[str, MetadataType]]
|
User-provided metadata to store with the artifact. |
None
|
materializer
|
Optional[MaterializerClassOrSource]
|
The materializer to use for saving the artifact to the artifact store. |
None
|
uri
|
Optional[str]
|
The URI within the artifact store to upload the artifact
to. If not provided, the artifact will be uploaded to
|
None
|
save_type
|
ArtifactSaveType
|
The type of save operation that created the artifact version. |
MANUAL
|
has_custom_name
|
bool
|
If the artifact name is custom and should be listed in the dashboard "Artifacts" tab. |
True
|
Returns:
| Type | Description |
|---|---|
ArtifactVersionResponse
|
The saved artifact response. |
Source code in src/zenml/artifacts/utils.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
show(local: bool = False, ngrok_token: Optional[str] = None) -> None
Show the ZenML dashboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
local
|
bool
|
Whether to show the dashboard for the local server or the one for the active server. |
False
|
ngrok_token
|
Optional[str]
|
An ngrok auth token to use for exposing the ZenML dashboard on a public domain. Primarily used for accessing the dashboard in Colab. |
None
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no server is connected. |
Source code in src/zenml/utils/dashboard_utils.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
step(_func: Optional[F] = None, *, name: Optional[str] = None, enable_cache: Optional[bool] = None, enable_artifact_metadata: Optional[bool] = None, enable_artifact_visualization: Optional[bool] = None, enable_step_logs: Optional[bool] = None, experiment_tracker: Optional[Union[bool, str]] = None, step_operator: Optional[Union[bool, str]] = None, output_materializers: Optional[OutputMaterializersSpecification] = None, environment: Optional[Dict[str, Any]] = None, secrets: Optional[List[Union[UUID, str]]] = None, settings: Optional[Dict[str, SettingsOrDict]] = None, extra: Optional[Dict[str, Any]] = None, on_failure: Optional[HookSpecification] = None, on_success: Optional[HookSpecification] = None, model: Optional[Model] = None, retry: Optional[StepRetryConfig] = None, substitutions: Optional[Dict[str, str]] = None, cache_policy: Optional[CachePolicyOrString] = None, runtime: Optional[StepRuntime] = None, heartbeat_healthy_threshold: Optional[int] = None, group: Optional[Union[GroupInfo, str]] = None) -> Union[BaseStep, Callable[[F], BaseStep]]
step(_func: F) -> BaseStep
step(
*,
name: Optional[str] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_artifact_visualization: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
experiment_tracker: Optional[Union[bool, str]] = None,
step_operator: Optional[Union[bool, str]] = None,
output_materializers: Optional[
OutputMaterializersSpecification
] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
cache_policy: Optional[CachePolicyOrString] = None,
runtime: Optional[StepRuntime] = None,
heartbeat_healthy_threshold: Optional[int] = None,
group: Optional[Union[GroupInfo, str]] = None,
) -> Callable[[F], BaseStep]
Decorator to create a ZenML step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_func
|
Optional[F]
|
The decorated function. |
None
|
name
|
Optional[str]
|
The name of the step. If left empty, the name of the decorated function will be used as a fallback. |
None
|
enable_cache
|
Optional[bool]
|
Specify whether caching is enabled for this step. If no value is passed, caching is enabled by default. |
None
|
enable_artifact_metadata
|
Optional[bool]
|
Specify whether metadata is enabled for this step. If no value is passed, metadata is enabled by default. |
None
|
enable_artifact_visualization
|
Optional[bool]
|
Specify whether visualization is enabled for this step. If no value is passed, visualization is enabled by default. |
None
|
enable_step_logs
|
Optional[bool]
|
Specify whether step logs are enabled for this step. |
None
|
experiment_tracker
|
Optional[Union[bool, str]]
|
The experiment tracker to use for this step. |
None
|
step_operator
|
Optional[Union[bool, str]]
|
The step operator to use for this step. |
None
|
output_materializers
|
Optional[OutputMaterializersSpecification]
|
Output materializers for this step. If given as a dict, the keys must be a subset of the output names of this step. If a single value (type or string) is given, the materializer will be used for all outputs. |
None
|
environment
|
Optional[Dict[str, Any]]
|
Environment variables to set when running this step. |
None
|
secrets
|
Optional[List[Union[UUID, str]]]
|
Secrets to set as environment variables when running this step. |
None
|
settings
|
Optional[Dict[str, SettingsOrDict]]
|
Settings for this step. |
None
|
extra
|
Optional[Dict[str, Any]]
|
Extra configurations for this step. |
None
|
on_failure
|
Optional[HookSpecification]
|
Callback function in event of failure of the step. Can be a
function with a single argument of type |
None
|
on_success
|
Optional[HookSpecification]
|
Callback function in event of success of the step. Can be a
function with no arguments, or a source path to such a function
(e.g. |
None
|
model
|
Optional[Model]
|
configuration of the model in the Model Control Plane. |
None
|
retry
|
Optional[StepRetryConfig]
|
configuration of step retry in case of step failure. |
None
|
substitutions
|
Optional[Dict[str, str]]
|
Extra substitutions for model and artifact name placeholders. |
None
|
cache_policy
|
Optional[CachePolicyOrString]
|
Cache policy for this step. |
None
|
runtime
|
Optional[StepRuntime]
|
The step runtime. If not configured, the step will run inline unless a step operator or docker/resource settings are configured. This is only applicable for dynamic pipelines. |
None
|
heartbeat_healthy_threshold
|
Optional[int]
|
The amount of time (in minutes) that a running step has not received heartbeat and is considered healthy. By default, set to 30 minutes. |
None
|
group
|
Optional[Union[GroupInfo, str]]
|
The group information for this step. |
None
|
Returns:
| Type | Description |
|---|---|
Union[BaseStep, Callable[[F], BaseStep]]
|
The step instance. |
Source code in src/zenml/steps/step_decorator.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
unmapped(value: T) -> _Unmapped[T]
Helper function to pass an input without mapping over it.
Wrap any step input with this function and then pass it to step.map(...)
to pass the full value to all steps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
T
|
The value to wrap. |
required |
Returns:
| Type | Description |
|---|---|
_Unmapped[T]
|
The wrapped value. |
Source code in src/zenml/execution/pipeline/dynamic/utils.py
46 47 48 49 50 51 52 53 54 55 56 57 58 | |